Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
-
import re
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
|
|
|
| 4 |
|
| 5 |
model_checkpoint = "erwanlc/t5-cocktails_recipe-base"
|
| 6 |
tt_generator = pipeline("text2text-generation", model=model_checkpoint)
|
|
@@ -18,6 +18,7 @@ def generate_text(ingredients):
|
|
| 18 |
for matches in all_matches:
|
| 19 |
result[-1] = result[-1].replace(matches, f"\n{matches}")
|
| 20 |
result = [item.strip() for item in result]
|
|
|
|
| 21 |
result = "\n".join(result)
|
| 22 |
return result
|
| 23 |
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
+
import re
|
| 4 |
|
| 5 |
model_checkpoint = "erwanlc/t5-cocktails_recipe-base"
|
| 6 |
tt_generator = pipeline("text2text-generation", model=model_checkpoint)
|
|
|
|
| 18 |
for matches in all_matches:
|
| 19 |
result[-1] = result[-1].replace(matches, f"\n{matches}")
|
| 20 |
result = [item.strip() for item in result]
|
| 21 |
+
result[-1] = f"\nIngredients:\n{result[-1]}"
|
| 22 |
result = "\n".join(result)
|
| 23 |
return result
|
| 24 |
|