ccclllwww commited on
Commit
a200433
Β·
verified Β·
1 Parent(s): 49964d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -159,22 +159,20 @@ def main():
159
  # Generation button
160
  if st.button("✨ Generate Story & Audio"):
161
  with st.spinner("Processing your request..."):
162
- # Generate outputs
163
- caption = generate_image_caption(image)
164
- sys_prompt = "You are a fantasy writer. Create a 100-word adventure story about "
165
- story = generate_story_content(sys_prompt, caption)
166
- speech = generate_audio_from_story(story)
167
-
168
- # Display results
169
  with col2:
170
  st.subheader("πŸ” Scene Description")
 
171
  st.write(caption)
172
 
173
  st.subheader("πŸ“– Generated Story")
 
 
174
  st.write(story)
175
 
176
  st.subheader("πŸ”Š Audio Playback")
177
- st.audio(speech["audio"], sample_rate=audio_file["sampling_rate"], format='audio/wav')
 
178
 
179
  # Download button
180
  with open(speech["audio"], "rb") as audio_file:
 
159
  # Generation button
160
  if st.button("✨ Generate Story & Audio"):
161
  with st.spinner("Processing your request..."):
162
+ # Generate outputs and Display results
 
 
 
 
 
 
163
  with col2:
164
  st.subheader("πŸ” Scene Description")
165
+ caption = generate_image_caption(image)
166
  st.write(caption)
167
 
168
  st.subheader("πŸ“– Generated Story")
169
+ sys_prompt = "You are a fantasy writer. Create a 100-word adventure story about "
170
+ story = generate_story_content(sys_prompt, caption)
171
  st.write(story)
172
 
173
  st.subheader("πŸ”Š Audio Playback")
174
+ speech = generate_audio_from_story(story)
175
+ st.audio(speech["audio"], sample_rate=speech["sampling_rate"], format='audio/wav')
176
 
177
  # Download button
178
  with open(speech["audio"], "rb") as audio_file: