Update app.py
Browse files
app.py
CHANGED
@@ -200,9 +200,12 @@ if uploaded_file:
|
|
200 |
if st.button("π Listen to Diagnosis"):
|
201 |
with st.spinner("Generating audio... π΅"):
|
202 |
# Translate the diagnosis to the target language
|
203 |
-
|
204 |
-
|
205 |
-
|
|
|
|
|
|
|
206 |
# Filter out unwanted characters like '#' and '*'
|
207 |
filtered_text = ''.join(c for c in translated_text if c not in ['#', '*'])
|
208 |
# Now process the translated text for TTS
|
|
|
200 |
if st.button("π Listen to Diagnosis"):
|
201 |
with st.spinner("Generating audio... π΅"):
|
202 |
# Translate the diagnosis to the target language
|
203 |
+
|
204 |
+
if language != 'en':
|
205 |
+
translator = Translator()
|
206 |
+
translated_text = translator.translate(diagnosis, dest=language)
|
207 |
+
else:
|
208 |
+
translated_text = diagnosis
|
209 |
# Filter out unwanted characters like '#' and '*'
|
210 |
filtered_text = ''.join(c for c in translated_text if c not in ['#', '*'])
|
211 |
# Now process the translated text for TTS
|