Spaces:
Build error
Build error
Leo Liu commited on
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|