Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,15 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
def predict(text, name):
|
| 6 |
pipe = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
|
| 7 |
-
|
|
|
|
|
|
|
| 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()
|