di-mitris commited on
Commit
dfe2080
1 Parent(s): 7cdfeb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -38,14 +38,13 @@ def main():
38
  img_bytes = BytesIO()
39
  image.save(img_bytes, format="JPEG")
40
  img_text_response = img2text(img_bytes.getvalue())
41
- description = img_text_response[0]['generated_text']
42
 
43
  # Convert text description to audio
44
- tts_payload = {"text": description}
45
  tts(tts_payload)
46
 
47
  # Play the audio
48
- playsound('audio.flac')
49
 
50
  st.success("Audio generated successfully!")
51
 
 
38
  img_bytes = BytesIO()
39
  image.save(img_bytes, format="JPEG")
40
  img_text_response = img2text(img_bytes.getvalue())
 
41
 
42
  # Convert text description to audio
43
+ tts_payload = {"text": img_text_response[0]['generated_text']}
44
  tts(tts_payload)
45
 
46
  # Play the audio
47
+ st.audio('audio.flac')
48
 
49
  st.success("Audio generated successfully!")
50