Spaces:
Runtime error
Runtime error
rsatish1110
commited on
Commit
•
c392459
1
Parent(s):
9f08a08
Create new file
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
|
3 |
+
model = pipeline("text-generation")
|
4 |
+
|
5 |
+
|
6 |
+
def predict(prompt):
|
7 |
+
completion = model(prompt)[0]["generated_text"]
|
8 |
+
return completion
|
9 |
+
|
10 |
+
import gradio as gr
|
11 |
+
|
12 |
+
gr.Interface(fn=predict, inputs="text", outputs="text").launch()
|