Update app.py
Browse files
app.py
CHANGED
@@ -59,14 +59,16 @@ def generation_function(texts):
|
|
59 |
tokenizer.batch_decode(generated, skip_special_tokens=False),
|
60 |
special_tokens
|
61 |
)
|
62 |
-
return generated_recipe
|
|
|
63 |
|
64 |
iface = gr.Interface(
|
65 |
fn=generation_function,
|
66 |
inputs="text",
|
67 |
outputs="text",
|
68 |
title="Recipe Generation",
|
69 |
-
description="Generate a recipe based on an input text."
|
|
|
70 |
)
|
71 |
|
72 |
if __name__ == "__main__":
|
|
|
59 |
tokenizer.batch_decode(generated, skip_special_tokens=False),
|
60 |
special_tokens
|
61 |
)
|
62 |
+
return generated_recipe[0] # Return the first generated recipe as a string
|
63 |
+
|
64 |
|
65 |
iface = gr.Interface(
|
66 |
fn=generation_function,
|
67 |
inputs="text",
|
68 |
outputs="text",
|
69 |
title="Recipe Generation",
|
70 |
+
description="Generate a recipe based on an input text.",
|
71 |
+
api_name="/predict" # Set the named endpoint to /predict
|
72 |
)
|
73 |
|
74 |
if __name__ == "__main__":
|