Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gardio as gr
|
2 |
+
|
3 |
+
from transformers import pipeline
|
4 |
+
|
5 |
+
def predict(text, name):
|
6 |
+
pipe = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
|
7 |
+
return pipe(text)[0]["translation_text"]
|
8 |
+
|
9 |
+
demo = gr.Interface(
|
10 |
+
fn=predict
|
11 |
+
inputs('text','text'),
|
12 |
+
outputs='text' ,
|
13 |
+
)
|
14 |
+
demo.launch()
|