2006elad commited on
Commit
5d0c4c8
·
1 Parent(s): 0b561c2

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
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()