A lightweight fine-tuned Llama-based language model that classifies foods as either Healthy or Unhealthy.
This model was trained on a custom food classification dataset using supervised fine-tuning and exported to GGUF format for compatibility with local inference tools like LM Studio and llama.cpp.
The health_food_demo in spaces may not yeild better results as it is a quantized model.
1### Question:
2Is Apples healthy or unhealthy?
3
4### Answer:
5Healthy
1### Question:
2Is French Fries healthy or unhealthy?
3
4### Answer:
5Unhealthy
This model can be served locally using LM Studio's OpenAI-compatible API server.
1 curl http://localhost:1234/v1/completions \
2 -H "Content-Type: application/json" \
3 -d '{
4 "model": "health_food_demo-Q4_K_M",
5 "prompt": "Is Cucumber healthy or unhealthy?\n### Answer:\n",
6 "temperature": 0,
7 "top_p": 1,
8 "max_tokens": 5
9 }'
1{
2 "choices": [
3 {
4 "text": "Unhealthy"
5 }
6 ]
7}
1from llama_cpp import Llama
2
3llm = Llama(
4 model_path="health-food-demo-Q4_K_M.gguf",
5 n_ctx=2048,
6)
7
8prompt = '''
9### Question:
10Is Pizza healthy or unhealthy?
11
12### Answer:
13'''
14
15output = llm(
16 prompt,
17 max_tokens=10,
18 stop=["<|endoftext|>"]
19)
20
21print(output["choices"][0]["text"])
The model was fine-tuned on a custom dataset containing food-related prompts and labels.
1### Question:
2Is Salmon healthy or unhealthy?
3
4### Answer:
5Healthy
The training dataset included both healthy and unhealthy foods.
This is a small educational/demo model and should not be used for medical or nutritional advice.