Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def img2text(image_path):
|
|
34 |
# Text to Story (Generate a Complete Story) | 文字 → 故事(生成完整故事)
|
35 |
def text2story(text):
|
36 |
prompt = f"Write a fun and magical children's story based on this idea: {text}.\n\nOnce upon a time..."
|
37 |
-
story = story_generator(prompt, max_length=
|
38 |
return story
|
39 |
|
40 |
# Story to Speech (TTS) | 故事 → 語音(TTS)
|
|
|
34 |
# Text to Story (Generate a Complete Story) | 文字 → 故事(生成完整故事)
|
35 |
def text2story(text):
|
36 |
prompt = f"Write a fun and magical children's story based on this idea: {text}.\n\nOnce upon a time..."
|
37 |
+
story = story_generator(prompt, max_length=300, do_sample=True, temperature=0.8, top_p=0.9, repetition_penalty=1.2)[0]['generated_text']
|
38 |
return story
|
39 |
|
40 |
# Story to Speech (TTS) | 故事 → 語音(TTS)
|