Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,7 +41,7 @@ def main():
|
|
41 |
with open(uploaded_file.name, "wb") as file:
|
42 |
file.write(bytes_data)
|
43 |
|
44 |
-
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
45 |
|
46 |
# Stage 1: Image to Text
|
47 |
st.text('Processing img2text...')
|
@@ -58,11 +58,11 @@ def main():
|
|
58 |
st.session_state.audio_data = text2audio(st.session_state.story)
|
59 |
|
60 |
elif st.session_state.scenario:
|
61 |
-
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
62 |
st.write("Image Caption: ", st.session_state.scenario)
|
63 |
st.write("Generated Story: ", st.session_state.story)
|
64 |
|
65 |
-
# Play button
|
66 |
if st.session_state.audio_data and st.button("Play Audio"):
|
67 |
st.audio(st.session_state.audio_data['audio'],
|
68 |
format="audio/wav",
|
|
|
41 |
with open(uploaded_file.name, "wb") as file:
|
42 |
file.write(bytes_data)
|
43 |
|
44 |
+
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
45 |
|
46 |
# Stage 1: Image to Text
|
47 |
st.text('Processing img2text...')
|
|
|
58 |
st.session_state.audio_data = text2audio(st.session_state.story)
|
59 |
|
60 |
elif st.session_state.scenario:
|
61 |
+
st.image(uploaded_file, caption="Uploaded Image", use_container_width=True)
|
62 |
st.write("Image Caption: ", st.session_state.scenario)
|
63 |
st.write("Generated Story: ", st.session_state.story)
|
64 |
|
65 |
+
# Play button (No reprocessing)
|
66 |
if st.session_state.audio_data and st.button("Play Audio"):
|
67 |
st.audio(st.session_state.audio_data['audio'],
|
68 |
format="audio/wav",
|