Spaces:
Build error
Build error
Commit
·
e5cc669
1
Parent(s):
9cff25c
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
generator = pipeline("text-generation", model = "distilgpt2")
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
prompt = "This tutorial is about"
|
| 8 |
+
generator(prompt, max_length = 30)
|
| 9 |
+
|
| 10 |
+
iface = gr.Interface(fn=generate_text, inputs="text", outputs="text")
|
| 11 |
+
iface.launch()
|