akhooli commited on
Commit
a50edcb
1 Parent(s): 2f068c3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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