Sobit commited on
Commit
909768a
Β·
verified Β·
1 Parent(s): ae9f3a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
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
- translator = Translator()
204
- diagnosis = diagnosis.text
205
- translated_text = translator.translate(diagnosis, dest=language)
 
 
 
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