Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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":
|
45 |
tts(tts_payload)
|
46 |
|
47 |
# Play the audio
|
48 |
-
|
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 |
|