CaiRou-Huang commited on
Commit
1c427fd
1 Parent(s): 883894b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -4,7 +4,7 @@ from transformers import pipeline
4
  pipe = pipeline("text-generation")
5
 
6
  def predict(prompt):
7
- completion = model(prompt)[0]["generated_text"]
8
  return completion
9
 
10
  iface = gr.Interface(fn=predict, inputs="text", outputs="text")
 
4
  pipe = pipeline("text-generation")
5
 
6
  def predict(prompt):
7
+ completion = pipe(prompt, max_length=50, num_return_sequences=1)[0]["generated_text"]
8
  return completion
9
 
10
  iface = gr.Interface(fn=predict, inputs="text", outputs="text")