JSY8 commited on
Commit
cd9cb87
ยท
verified ยท
1 Parent(s): 2b97f42

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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("โœจ Magic Story Maker โœจ")
76
- st.markdown("Upload a picture to make a funny story and hear it too! ๐Ÿ“ธ")
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("โœจ Make My Story! โœจ"):
87
  if uploaded_image is not None:
88
- with st.spinner("๐Ÿ”ฎ Creating your magical story..."):
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! ๐Ÿ“ธ")
 
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! ")