Spaces:
Sleeping
Sleeping
AndriiPets
commited on
Commit
•
f956d85
1
Parent(s):
b2ea0e8
title fix
Browse files- generator.py +2 -1
generator.py
CHANGED
@@ -106,12 +106,13 @@ def generation_function(texts, lang="en"):
|
|
106 |
recepie = tokenizer.decode(output_ids, skip_special_tokens=False)
|
107 |
|
108 |
generated_recipe = skip_special_tokens_and_prettify(recepie)
|
|
|
109 |
|
110 |
if lang != "en" and lang in langs:
|
111 |
generated_recipe = translate_recepie(generated_recipe, lang)
|
112 |
|
113 |
cook_image = generate_cook_image(
|
114 |
-
|
115 |
|
116 |
generated_recipe["image"] = cook_image
|
117 |
|
|
|
106 |
recepie = tokenizer.decode(output_ids, skip_special_tokens=False)
|
107 |
|
108 |
generated_recipe = skip_special_tokens_and_prettify(recepie)
|
109 |
+
original_title = generated_recipe["title"]
|
110 |
|
111 |
if lang != "en" and lang in langs:
|
112 |
generated_recipe = translate_recepie(generated_recipe, lang)
|
113 |
|
114 |
cook_image = generate_cook_image(
|
115 |
+
original_title, app_id=api_credentials['ID'], app_key=api_credentials['KEY'])
|
116 |
|
117 |
generated_recipe["image"] = cook_image
|
118 |
|