IrisDeng commited on
Commit
f3b2a4f
·
verified ·
1 Parent(s): 8294507

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -38,7 +38,11 @@ def compose_story_from_caption(caption_detail):
38
  )
39
  story_results = story_pipeline(prompt_text, num_return_sequences=1)
40
  story_text = story_results[0]['generated_text']
41
- return story_text
 
 
 
 
42
 
43
 
44
  def convert_text_to_audio(text_content, audio_path="output.mp3"):
 
38
  )
39
  story_results = story_pipeline(prompt_text, num_return_sequences=1)
40
  story_text = story_results[0]['generated_text']
41
+ if "Story:" in story_text:
42
+ story = story_text.split("Story:", 1)[1].strip()
43
+ else:
44
+ story = story_text.strip()
45
+ return story
46
 
47
 
48
  def convert_text_to_audio(text_content, audio_path="output.mp3"):