Leo Liu commited on
Commit
f02966b
·
verified ·
1 Parent(s): e22b677

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -24,7 +24,12 @@ def text2story(text):
24
  top_p=0.95,
25
  temperature=0.7)
26
  generation = story_text(story_prompt)
27
- story_text = generation[0]['generated_text']
 
 
 
 
 
28
  return story_text
29
 
30
  # text2audio
 
24
  top_p=0.95,
25
  temperature=0.7)
26
  generation = story_text(story_prompt)
27
+ raw_output = generation[0]['generated_text']
28
+
29
+ if raw_output.startswith(story_prompt):
30
+ story_text = raw_output[len(story_prompt):].strip()
31
+ else:
32
+ story_text = raw_output
33
  return story_text
34
 
35
  # text2audio