Leo Liu commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,20 +15,8 @@ def img2text(url):
|
|
| 15 |
|
| 16 |
# text2story
|
| 17 |
def text2story(text):
|
| 18 |
-
pipe = pipeline(
|
| 19 |
-
|
| 20 |
-
model="pranavpsv/genre-story-generator-v2",
|
| 21 |
-
max_new_tokens=300,
|
| 22 |
-
min_new_tokens=100,
|
| 23 |
-
do_sample=True,
|
| 24 |
-
temperature=0.65,
|
| 25 |
-
top_p=0.85,
|
| 26 |
-
top_k=30,
|
| 27 |
-
repetition_penalty=1.3,
|
| 28 |
-
no_repeat_ngram_size=3,
|
| 29 |
-
early_stopping=False
|
| 30 |
-
)
|
| 31 |
-
story_text = pipe(text, return_full_text=False)[0]['generated_text']
|
| 32 |
return story_text
|
| 33 |
|
| 34 |
|
|
|
|
| 15 |
|
| 16 |
# text2story
|
| 17 |
def text2story(text):
|
| 18 |
+
pipe = pipeline("text-generation", model="pranavpsv/genre-story-generator-v2",max_new_tokens=300, min_new_tokens=100)
|
| 19 |
+
story_text = pipe(text)[0]['generated_text']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
return story_text
|
| 21 |
|
| 22 |
|