Leo Liu
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -16,9 +16,8 @@ def img2text(url):
|
|
16 |
|
17 |
# text2story
|
18 |
def text2story(text):
|
19 |
-
prompt = f"Write a children's story for ages 3-10 based on: {text}"
|
20 |
pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2", max_new_tokens=160, min_new_tokens=130, num_return_sequences=1)
|
21 |
-
story_text = pipe(
|
22 |
return story_text
|
23 |
|
24 |
|
|
|
16 |
|
17 |
# text2story
|
18 |
def text2story(text):
|
|
|
19 |
pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2", max_new_tokens=160, min_new_tokens=130, num_return_sequences=1)
|
20 |
+
story_text = pipe(text)[0]['generated_text']
|
21 |
return story_text
|
22 |
|
23 |
|