Spaces:
Sleeping
Sleeping
Update app.py
Browse files22 unmodified lines23242526262728293031333432333435365 unmodified lines4243444645464722 unmodified lines
pipe_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." 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 lines return ingredients except Exception as e: return f"Error generating ingredients: {e}"
# Streamlit app setupst.title("Food Image Recognition with Ingredients")
app.py+2-4