Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -72,23 +72,23 @@ def generate_content(image):
|
|
72 |
return caption, story, temp_file_path
|
73 |
|
74 |
# Streamlit UI
|
75 |
-
st.title("
|
76 |
-
st.markdown("Upload a picture
|
77 |
|
78 |
uploaded_image = st.file_uploader("Choose your picture", type=["jpg", "jpeg", "png"])
|
79 |
|
80 |
# Streamlit UI (modified image display section)
|
81 |
if uploaded_image is None:
|
82 |
-
st.image("https://example.com/placeholder_image.jpg", caption="Upload your picture here!
|
83 |
else:
|
84 |
st.image(uploaded_image, caption="Your Picture ๐", use_container_width=True)
|
85 |
|
86 |
-
if st.button("
|
87 |
if uploaded_image is not None:
|
88 |
-
with st.spinner("
|
89 |
caption, story, audio_path = generate_content(uploaded_image)
|
90 |
-
st.success("
|
91 |
st.audio(audio_path, format="audio/wav")
|
92 |
os.remove(audio_path)
|
93 |
else:
|
94 |
-
st.warning("Please upload a picture first!
|
|
|
72 |
return caption, story, temp_file_path
|
73 |
|
74 |
# Streamlit UI
|
75 |
+
st.title("๐Story Maker")
|
76 |
+
st.markdown("Upload a picture, I will generate a story for you")
|
77 |
|
78 |
uploaded_image = st.file_uploader("Choose your picture", type=["jpg", "jpeg", "png"])
|
79 |
|
80 |
# Streamlit UI (modified image display section)
|
81 |
if uploaded_image is None:
|
82 |
+
st.image("https://example.com/placeholder_image.jpg", caption="Upload your picture here!", use_container_width=True)
|
83 |
else:
|
84 |
st.image(uploaded_image, caption="Your Picture ๐", use_container_width=True)
|
85 |
|
86 |
+
if st.button("Generate a story"):
|
87 |
if uploaded_image is not None:
|
88 |
+
with st.spinner("Processing"):
|
89 |
caption, story, audio_path = generate_content(uploaded_image)
|
90 |
+
st.success(" Your story is ready!๐")
|
91 |
st.audio(audio_path, format="audio/wav")
|
92 |
os.remove(audio_path)
|
93 |
else:
|
94 |
+
st.warning("Please upload a picture first! ")
|