Spaces:
Sleeping
Sleeping
Update app.py
Browse files22 unmodified lines2324252627282930313233343536375 unmodified lines4344454647484922 unmodified linespipe_llama = load_llama_pipeline()# Function to generate ingredients using GPT-Neodef get_ingredients_llama(food_name):"""Generate a list of ingredients for the given food item using GPT-Neo.Returns a clean, comma-separated list of ingredients."""prompt = (f"List the main ingredients typically used to prepare {food_name}. ""Provide the ingredients as a concise, comma-separated list without any explanations.")try:response = pipe_llama(prompt, max_length=50, num_return_sequences=1)5 unmodified linesreturn ingredientsexcept Exception as e:return f"Error generating ingredients: {e}"# Streamlit app setupst.title("Food Image Recognition with Ingredients")22 unmodified lines23242526272829303132333435365 unmodified lines42434445464722 unmodified linespipe_llama = load_llama_pipeline()def get_ingredients_llama(food_name):"""Generate a list of ingredients for the given food item using GPT-Neo.Returns a clean, comma-separated list of ingredients."""prompt = (f"List only the main ingredients typically used to prepare {food_name}. ""Respond with just the ingredients in a comma-separated list without any extra text or explanations.")try:response = pipe_llama(prompt, max_length=50, num_return_sequences=1)5 unmodified linesreturn ingredientsexcept Exception as e:return f"Error generating ingredients: {e}"# Streamlit app setupst.title("Food Image Recognition with Ingredients")
app.py+2-4