Food Assistant – Falcon3-7B-Instruct (Fine-tuned with QLoRA)

Model Description

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.


Model Details

Model Description

  • Developed by: Maigamhdsidy
  • Funded by: Academic project (I3AFD Course)
  • Shared by: Maigamhdsidy
  • Model type: Causal Language Model fine‑tuned for structured information extraction
  • Language(s) (NLP): English
  • License: Apache‑2.0
  • Finetuned from model: tiiuae/Falcon3-7B-Instruct

Model Sources


Uses

Direct Use

You can use this model to:

  • Automatically extract nutrient lists from food names.
  • Enrich food databases or recipe applications.
  • Assist in dietary planning and nutritional analysis.

Downstream Use

The model can be integrated into chatbots, mobile apps, or web services that need quick nutritional information.

Out‑of‑Scope Use

  • The model is not a general‑purpose conversational AI.
  • It should not be used for medical diagnosis or clinical nutrition advice.
  • It may hallucinate values for foods not present in the training set.

Bias, Risks, and Limitations

  • Data bias: The training data comes from a specific dataset that may not cover all foods or cuisines.
  • Hallucination: For unknown foods, the model may generate plausible but incorrect nutrient values.
  • Units: The model outputs values with units (g, mg, kcal, etc.) but does not guarantee precision.
  • Recommendations: Always verify generated nutritional data with trusted sources before using in critical applications.

How to Get Started with the Model

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))
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for maigamhdsidy/food-assistant

Finetuned
(36)
this model