Sobit commited on
Commit
b271df0
Β·
verified Β·
1 Parent(s): 970af33

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -209,16 +209,14 @@ if uploaded_file:
209
  st.write("**AI:**", entry["response"])
210
 
211
  # Convert diagnosis to speech if enabled
212
- from googletrans import Translator
213
 
214
  if tts_enabled:
215
- if st.button("πŸ”Š Listen", key=f"listen_history_{file_id}_{i}"):
216
- with st.spinner("Generating audio..."):
217
- audio_bytes = text_to_speech(response, language)
218
  if audio_bytes:
219
- st.audio(audio_bytes, format='audio/mp3')
220
-
221
-
222
  else:
223
  st.write("βœ… No high-confidence diseases detected.")
224
 
 
209
  st.write("**AI:**", entry["response"])
210
 
211
  # Convert diagnosis to speech if enabled
212
+
213
 
214
  if tts_enabled:
215
+ if st.button("πŸ”Š Listen to Diagnosis"):
216
+ with st.spinner("Generating audio... 🎡"):
217
+ audio_bytes = text_to_speech(diagnosis, language)
218
  if audio_bytes:
219
+ st.audio(audio_bytes, format="audio/mp3")
 
 
220
  else:
221
  st.write("βœ… No high-confidence diseases detected.")
222