Spaces:
Runtime error
Runtime error
Commit ·
3f05601
1
Parent(s): c3e84b7
Update app.py
Browse files
app.py
CHANGED
|
@@ -43,7 +43,7 @@ def text2speach(text):
|
|
| 43 |
print(response)
|
| 44 |
with open('audio.flac', 'wb') as file:
|
| 45 |
file.write(response.content)
|
| 46 |
-
|
| 47 |
|
| 48 |
st.header("Image to Story:")
|
| 49 |
uploaded_image = st.file_uploader('Choose an image')
|
|
@@ -54,11 +54,11 @@ if uploaded_image is not None:
|
|
| 54 |
st.image(uploaded_image, caption="Uploaded Image", width=400)
|
| 55 |
scenario = img2text(uploaded_image.name)
|
| 56 |
story = generate_story(scenario)
|
| 57 |
-
text2speach(story)
|
| 58 |
|
| 59 |
with st.expander("Scenario"):
|
| 60 |
st.write(scenario)
|
| 61 |
with st.expander("Story"):
|
| 62 |
st.write(story)
|
| 63 |
-
|
| 64 |
-
|
|
|
|
| 43 |
print(response)
|
| 44 |
with open('audio.flac', 'wb') as file:
|
| 45 |
file.write(response.content)
|
| 46 |
+
return True
|
| 47 |
|
| 48 |
st.header("Image to Story:")
|
| 49 |
uploaded_image = st.file_uploader('Choose an image')
|
|
|
|
| 54 |
st.image(uploaded_image, caption="Uploaded Image", width=400)
|
| 55 |
scenario = img2text(uploaded_image.name)
|
| 56 |
story = generate_story(scenario)
|
| 57 |
+
completed = text2speach(story)
|
| 58 |
|
| 59 |
with st.expander("Scenario"):
|
| 60 |
st.write(scenario)
|
| 61 |
with st.expander("Story"):
|
| 62 |
st.write(story)
|
| 63 |
+
if completed == True:
|
| 64 |
+
st.audio("audio.flac")
|