2006elad commited on
Commit
ea78aa8
·
1 Parent(s): ada2c64

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,14 +1,15 @@
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()
 
1
+ import gradio as gr
 
2
  from transformers import pipeline
3
 
4
  def predict(text, name):
5
  pipe = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
6
+ output = pipe(text)[0]
7
+ print("Pipeline output:", output) # Print the complete output dictionary
8
+ return output["translation_text"]
9
 
10
  demo = gr.Interface(
11
  fn=predict,
12
+ inputs=('text', 'text'),
13
+ outputs='text',
14
  )
15
  demo.launch()