Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,11 +2,11 @@ import gc
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
-
pipe = pipeline('text-generation', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
|
6 |
#gc.collect()
|
7 |
|
8 |
def sayPoetry(prompt):
|
9 |
-
gen = pipe(prompt, max_length=96)[0]["generated_text"]
|
10 |
poetry =""
|
11 |
for line in gen.split('.')[:-1]:
|
12 |
poetry += line
|
|
|
2 |
import gradio as gr
|
3 |
from transformers import pipeline
|
4 |
|
5 |
+
pipe = pipeline('text-generation', framework='pt', model='akhooli/ap2023', tokenizer='akhooli/ap2023')
|
6 |
#gc.collect()
|
7 |
|
8 |
def sayPoetry(prompt):
|
9 |
+
gen = pipe(prompt, max_length=96, temperature = 0.95)[0]["generated_text"]
|
10 |
poetry =""
|
11 |
for line in gen.split('.')[:-1]:
|
12 |
poetry += line
|