Downloads · 30 days
0
maigamhdsidy/food-assistant
food-assistant is a machine learning model from maigamhdsidy. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of Falcon3-7B-Instruct designed to extract nutritional components from a given food name. It returns a structured list of nutrients (proteins, fats, vitamins, minerals, etc.) based o…
Downloads · 30 days
0
Access
Public
Updated Jul 13, 2026
Repo size
177 MB
Likes
0
Public
Click a slice to open those files.
.safetensors177 MB · 95%
From the Hugging Face model README
This model is a fine-tuned version of Falcon3-7B-Instruct designed to extract nutritional components from a given food name. It returns a structured list of nutrients (proteins, fats, vitamins, minerals, etc.) based on a curated food composition dataset.
The fine-tuning was performed using QLoRA (Quantized Low‑Rank Adaptation) to achieve efficient training with limited GPU memory.
You can use this model to:
The model can be integrated into chatbots, mobile apps, or web services that need quick nutritional information.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
# Base model + adapter
base_model_name = "tiiuae/Falcon3-7B-Instruct"
adapter_path = "maigamhdsidy/food-assistant"
tokenizer = AutoTokenizer.from_pretrained(adapter_path)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
device_map="auto",
trust_remote_code=True
)
model = PeftModel.from_pretrained(model, adapter_path)
# Example prompt
prompt = """Given the following food name, return only its nutrient components.
Food name: Banana
Required output:
- Return only the components list."""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))