--- license: mit language: - en pipeline_tag: text-generation tags: - gguf - llama - food-classification - lmstudio - llama.cpp - text - instruction-tuning library_name: transformers base_model: TinyLlama/TinyLlama-1.1B-Chat-v1.0 task_categories: - text-generation --- # Health Food Classifier (GGUF) 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. --- # Model Details - Base Architecture: LlamaForCausalLM - Format: GGUF - Quantization: Q4_K_M - Intended Use: Educational/demo food classification model - Inference Compatible With: - LM Studio - llama.cpp - Ollama (with conversion) - KoboldCpp - Text Generation WebUI --- # Healthy Foods Dataset Dataset: [healthyfoods](https://huggingface.co/datasets/jmarianodc/healthyfoods) --- # Healthy Foods Spaces Spaces: [health_food_demo](https://huggingface.co/spaces/jmarianodc/health_food_demo) The health_food_demo in spaces may not yeild better results as it is a quantized model. --- # Example Prompt ```text ### Question: Is Apples healthy or unhealthy? ### Answer: Healthy ``` ```text ### Question: Is French Fries healthy or unhealthy? ### Answer: Unhealthy ``` --- # LM Studio API Example This model can be served locally using LM Studio's OpenAI-compatible API server. Start the LM Studio server and load the model, then test it with: ```bash curl http://localhost:1234/v1/completions \ -H "Content-Type: application/json" \ -d '{ "model": "health_food_demo-Q4_K_M", "prompt": "Is Cucumber healthy or unhealthy?\n### Answer:\n", "temperature": 0, "top_p": 1, "max_tokens": 5 }' ``` Example response: ```json { "choices": [ { "text": "Unhealthy" } ] } ``` --- # Example Python Usage ```python from llama_cpp import Llama llm = Llama( model_path="health-food-demo-Q4_K_M.gguf", n_ctx=2048, ) prompt = ''' ### Question: Is Pizza healthy or unhealthy? ### Answer: ''' output = llm( prompt, max_tokens=10, stop=[" "] ) print(output["choices"][0]["text"]) ``` --- # Training The model was fine-tuned on a custom dataset containing food-related prompts and labels. Example training format: ```text ### Question: Is Salmon healthy or unhealthy? ### Answer: Healthy ``` The training dataset included both healthy and unhealthy foods. --- # Files | File | Description | |---|---| | `health_food_demo.gguf` | Full precision GGUF model | | `health_food_demo-Q4_K_M.gguf` | Quantized Q4_K_M version for lower RAM usage | | `README.md` | Model documentation | # Recommended Use: - `health_food_demo-Q4_K_M.gguf` for: - LM Studio - llama.cpp - low-memory local inference Use: - `health_food_demo.gguf` for: - highest quality inference - further quantization - experimentation --- # Notes This is a small educational/demo model and should not be used for medical or nutritional advice. --- # License MIT