Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,9 @@ from transformers import pipeline
|
|
4 |
model_checkpoint = "erwanlc/t5-cocktails_recipe-base"
|
5 |
tt_generator = pipeline("text2text-generation", model=model_checkpoint)
|
6 |
|
7 |
-
def generate_text(
|
8 |
-
result = tt_generator(
|
9 |
-
return result
|
10 |
|
11 |
output_text = gr.outputs.Textbox()
|
12 |
gr.Interface(fn=generate_text, inputs="textbox", outputs=output_text).launch(share=True)
|
|
|
4 |
model_checkpoint = "erwanlc/t5-cocktails_recipe-base"
|
5 |
tt_generator = pipeline("text2text-generation", model=model_checkpoint)
|
6 |
|
7 |
+
def generate_text(ingredients):
|
8 |
+
result = tt_generator(ingredients, min_length=20, max_length=1024, do_sample=True, temperature=1.0, top_p=1.0)
|
9 |
+
return result[0]["generated_text"]
|
10 |
|
11 |
output_text = gr.outputs.Textbox()
|
12 |
gr.Interface(fn=generate_text, inputs="textbox", outputs=output_text).launch(share=True)
|