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() |