erwanlc commited on
Commit
8f99873
·
1 Parent(s): 024b1b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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(inp):
8
- result = tt_generator(inp, min_length=20, max_length=1024, do_sample=True, temperature=1.0, top_p=1.0)
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)