File size: 455 Bytes
e99bad6 |
1 2 3 4 5 6 7 8 9 10 11 12 |
import gradio as gr
from transformers import pipeline
model_checkpoint = "erwanlc/t5-cocktails_recipe-base"
tt_generator = pipeline("text2text-generation", model=model_checkpoint)
def generate_text(inp):
result = tt_generator(inp, min_length=20, max_length=1024, do_sample=True, temperature=1.0, top_p=1.0)
return result
output_text = gr.outputs.Textbox()
gr.Interface(fn=generate_text, inputs="textbox", outputs=output_text).launch(share=True) |