File size: 414 Bytes
ea78aa8 5d0c4c8 ea78aa8 5d0c4c8 ada2c64 ea78aa8 5d0c4c8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
import gradio as gr
from transformers import pipeline
def predict(text, name):
pipe = pipeline("text2text-generation", model="flax-community/t5-recipe-generation")
output = pipe(text)[0]
print("Pipeline output:", output) # Print the complete output dictionary
return output["translation_text"]
demo = gr.Interface(
fn=predict,
inputs=('text', 'text'),
outputs='text',
)
demo.launch() |