DutchNomadCode commited on
Commit
dd13ee8
·
verified ·
1 Parent(s): bf6d39b

add text-generation pipeline

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -1,7 +1,9 @@
1
  import gradio as gr
 
2
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
 
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  iface.launch()
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
  def greet(name):
5
+ generator = pipeline("text-generation")
6
+ return generator(name)
7
 
8
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
9
  iface.launch()