Spaces:
Sleeping
Sleeping
Uploading FoodExtract demo app.py
Browse files41 unmodified lines42434445464748499 unmodified lines59606162636465666768697016 unmodified lines8788899091929341 unmodified lines# device_map="auto",# attn_implementation="eager"# )## # Create model pipeline# loaded_model_pipeline = pipeline("text-generation",# model=loaded_model,# tokenizer=tokenizer)9 unmodified lines# Create the demodescription = """Extract food and drink items from text with a fine-tuned SLM (Small Language Model) or more specifically a fine-tuned [Gemma 3 270M](https://huggingface.co/google/gemma-3-270m-it).Our model has been fine-tuned on the [FoodExtract-1k dataset](https://huggingface.co/datasets/objects76/FoodExtract-1k).* Input (str): Raw text strings or image captions (e.g. "A photo of a dog sitting on a beach" or "A breakfast plate with bacon, eggs and toast")* Output (str): Generated text with food/not_food classification as well as noun extracted food and drink items and various food tags.For example:16 unmodified linestitle="π³ Structured FoodExtract with a Fine-Tuned Gemma 3 270M",description=description,examples=[["Hello world! This is my first fine-tuned LLM!"],["A plate of food with grilled barramundi, salad with avocado, olives, tomatoes and Italian dressing"],["British Breakfast with baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, a cup of tea and toast and fried tomatoes"],["Steak tacos"],["A photo of a dog sitting on a beach"]]41 unmodified lines4243444546479 unmodified lines57585960616263646566676816 unmodified lines8586878889909141 unmodified lines# device_map="auto",# attn_implementation="eager"# )# loaded_model_pipeline = pipeline("text-generation",# model=loaded_model,# tokenizer=tokenizer)9 unmodified lines# Create the demodescription = """ν μ€νΈμμ μμκ³Ό μλ£ νλͺ©μ μΆμΆνλ νμΈνλλ SLM(Small Language Model)- basemodel: [Gemma 3 270M](https://huggingface.co/google/gemma-3-270m-it)- dataset: [FoodExtract-1k λ°μ΄ν°μ ](https://huggingface.co/datasets/objects76/FoodExtract-1k)* μ λ ₯ (str): μμ ν μ€νΈ λ¬Έμμ΄ λλ μ΄λ―Έμ§ μΊ‘μ (μ: "νν΄ μμ μλ κ°μ μ¬μ§" λλ "λ² μ΄μ»¨, κ³λ, ν μ€νΈκ° μλ μμΉ¨ μμ¬")* μΆλ ₯ (str): μμ/λΉμμ λΆλ₯μ μΆμΆλ λͺ μ¬ν μμ λ° μλ£ νλͺ©, λ€μν μμ νκ·Έκ° ν¬ν¨λ μμ± ν μ€νΈFor example:16 unmodified linestitle="π³ Structured FoodExtract with a Fine-Tuned Gemma 3 270M",description=description,examples=[["Hello world! This is my first fine-tuned LLM!"],["그릴μ κ΅¬μ΄ λ°λΌλ¬Έλμ μ보카λ, μ¬λ¦¬λΈ, ν λ§ν , μ΄ν리μ λλ μ±μ΄ κ³λ€μ¬μ§ μλ¬λκ° μλ ν μ μ μμ"],["British Breakfast with baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, a cup of tea and toast and fried tomatoes"],["Steak tacos"],["A photo of a dog sitting on a beach"]]
app.py+6-8