|
import gradio as gr |
|
|
|
|
|
def get_ingredients(food_name): |
|
ingredients_dict = { |
|
"pizza": ["Dough", "Tomato Sauce", "Cheese", "Pepperoni"], |
|
"pasta": ["Pasta", "Olive Oil", "Garlic", "Parmesan Cheese"], |
|
"burger": ["Bun", "Beef Patty", "Lettuce", "Tomato", "Cheese"], |
|
"salad": ["Lettuce", "Tomatoes", "Cucumbers", "Dressing"], |
|
"tacos": ["Tortilla", "Beef", "Lettuce", "Cheese", "Salsa"] |
|
} |
|
return ingredients_dict.get(food_name.lower(), "Ingredients not found for this food item.") |
|
|
|
|
|
interface = gr.Interface( |
|
fn=get_ingredients, |
|
inputs="text", |
|
outputs="text", |
|
title="Food Ingredients Finder", |
|
description="Enter the name of a food to get its ingredients." |
|
) |
|
|
|
|
|
interface.launch() |
|
|