Spaces:
Sleeping
Sleeping
| import gradio as gr | |
| from langchain_community.llms import Ollama | |
| ollama = Ollama(base_url='http://127.0.0.1:11434', model="mistral", top_k="10", temperature="0.3") | |
| def recipe_generator(text): | |
| return ollama.invoke("generate a single recipe for: '" + text + "' if a proper dish name was not provided, output error") | |
| iface = gr.Interface( | |
| fn=recipe_generator, | |
| inputs=gr.Textbox(label="Enter dish name", placeholder="Start typing..."), | |
| outputs=gr.Textbox(label="Generated Recipe"), | |
| title="Dish to Recipe Generator", | |
| description="Enter a dish you would like a recipe for (*you may also enter dietary restrictions and preferred cooking methods)", | |
| ) | |
| # Launch the Gradio interface | |
| iface.launch() | |