Downloads · 30 days
12
19% of all-time downloads
OmarShamakh/FoodExtract-gemma-3-270m-fine-tune-v1
FoodExtract-gemma-3-270m-fine-tune-v1 is a text generation model from OmarShamakh. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
This is a food and drink extraction language model fine-tuned from Gemma 3 270M.
Downloads · 30 days
12
19% of all-time downloads
All-time downloads
63
Public
Parameters
268M
570 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors536 MB · 94%
From the Hugging Face model README
This is a food and drink extraction language model fine-tuned from Gemma 3 270M.
Given raw text, it is designed to:
Input:
British Breakfast with baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, a cup of tea and toast and fried tomatoes
Output:
food_or_drink: 1
tags: fi, di
foods: British Breakfast, baked beans, fried eggs, black pudding, sausages, bacon, mushrooms, toast, fried tomatoes
drinks: tea
Fine-tuned on mrdbourke/FoodExtract-1k, 1400 samples of raw text paired with structured food/drink extraction labels generated by gpt-oss-120b.
| Tag | Meaning |
|---|---|
| np | nutrition_panel |
| il | ingredient_list |
| me | menu |
| re | recipe |
| fi | food_items |
| di | drink_items |
| fa | food_advertisement |
| fp | food_packaging |
transformers + trl (SFTTrainer)from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
MODEL_PATH = "OmarShamakh/FoodExtract-gemma-3-270m-fine-tune-v1"
model = AutoModelForCausalLM.from_pretrained(
MODEL_PATH, dtype="auto", device_map="auto", attn_implementation="eager"
)
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
input_text = "A plate with bacon, eggs and toast on it"
input_prompt = pipe.tokenizer.apply_chat_template(
conversation=[{"role": "user", "content": input_text}],
tokenize=False,
add_generation_prompt=True
)
output = pipe(input_prompt, max_new_tokens=256)
print(output[0]["generated_text"][len(input_prompt):])
Fine-tuned using Supervised Fine-Tuning (SFT) with Hugging Face's TRL library.