Spaces:
Sleeping
Sleeping
Commit
·
202b83f
1
Parent(s):
7599980
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
|
|
|
|
4 |
def greet(name):
|
5 |
return "Hello " + name + "!!"
|
6 |
|
7 |
-
|
|
|
|
|
|
|
8 |
iface.launch()
|
9 |
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
pipeline = pipeline(task="text-generation", model="gpt2")
|
5 |
+
|
6 |
def greet(name):
|
7 |
return "Hello " + name + "!!"
|
8 |
|
9 |
+
def gen_text(text):
|
10 |
+
return pipeline(text)[0]
|
11 |
+
|
12 |
+
iface = gr.Interface(fn=gen_text, inputs="text", outputs="text")
|
13 |
iface.launch()
|
14 |
|