MrMoeeee commited on
Commit
d050d18
Β·
verified Β·
1 Parent(s): 57279d5

Add model card with training details and graphs

Browse files
Files changed (1) hide show
  1. README.md +74 -43
README.md CHANGED
@@ -1,67 +1,98 @@
1
  ---
2
  license: apache-2.0
 
3
  tags:
4
- - lamp
5
- - iot
6
- - pixel-art
7
- - light-control
8
- - fine-tuned
9
- - gguf
10
- - ollama
 
 
 
11
  ---
12
 
13
- # LAMP Fine-Tuned Models
14
 
15
- Fine-tuned language models for the **LAMP** (Moonside Lamp Emulator) project. These models generate JSON light programs from natural language descriptions.
16
 
17
  ## Models
18
 
19
- | Model | Base | Parameters | GGUF Size | Final Eval Loss |
20
- |-------|------|-----------|-----------|-----------------|
21
- | `lamp-llama-3b.Q8_0.gguf` | Llama 3.2 3B Instruct | 3.2B | 3.2 GB | 0.0294 |
22
- | `lamp-gemma-4b.Q8_0.gguf` | Gemma 3 4B IT | 4.3B | 3.9 GB | 0.0247 |
23
 
24
  ## Training Details
25
 
26
- - **Method**: Full fine-tune (100% parameters trainable, not LoRA)
27
- - **Precision**: bf16
28
- - **Hardware**: NVIDIA H200 (140GB VRAM)
29
- - **Framework**: Unsloth + HuggingFace TRL
30
- - **Dataset**: 2,268 train / 253 validation examples
31
- - **Epochs**: 3
32
- - **Batch size**: 16 (4 per device x 4 gradient accumulation)
33
- - **Learning rate**: 2e-5 with cosine decay
34
- - **Optimizer**: AdamW
35
 
36
- ## Training Results
37
 
38
- ![Training Results](training_results.png)
39
 
40
- Both models converged well:
41
- - **Llama 3.2 3B**: Loss 1.38 -> 0.018, eval loss 0.0294
42
- - **Gemma 3 4B**: Loss 1.37 -> 0.018, eval loss 0.0247
43
 
44
- ## Usage with Ollama
45
 
46
- 1. Download the GGUF file
47
- 2. Create a Modelfile:
48
 
49
- ```
50
- # Modelfile.lamp-llama-3b
51
- FROM ./lamp-llama-3b.Q8_0.gguf
52
- PARAMETER temperature 0.3
53
- PARAMETER num_predict 4096
54
- PARAMETER stop <|eot_id|>
55
- ```
56
 
57
- 3. Create and run:
58
  ```bash
59
- ollama create lamp-llama-3b -f Modelfile.lamp-llama-3b
60
- ollama run lamp-llama-3b "warm and cozy"
 
 
 
 
 
 
 
 
 
 
61
  ```
62
 
63
- ## Example
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- **Input**: "Create a light program for: warm and cozy"
66
 
67
- **Output**: A JSON program controlling LED pixels with colors, animations, and timing for a warm ambient effect.
 
 
 
 
 
1
  ---
2
  license: apache-2.0
3
+ base_model: google/gemma-3-4b-it
4
  tags:
5
+ - gemma3
6
+ - gguf
7
+ - fine-tuned
8
+ - lamp
9
+ - lighting
10
+ - smart-home
11
+ - json
12
+ datasets:
13
+ - custom
14
+ pipeline_tag: text-generation
15
  ---
16
 
17
+ # LAMP Models β€” Fine-tuned for Smart Lighting Control
18
 
19
+ Fine-tuned language models that generate JSON lighting programs from natural language descriptions.
20
 
21
  ## Models
22
 
23
+ | Model | Base | Params | GGUF Size | Final Eval Loss |
24
+ |-------|------|--------|-----------|-----------------|
25
+ | **lamp-gemma-4b-v2** | Gemma 3 4B IT | 4.3B | ~4.1 GB (Q8_0) | 0.0288 |
 
26
 
27
  ## Training Details
28
 
29
+ - **Fine-tune Type:** Full parameter (no LoRA) β€” all 4,300,079,472 parameters trained
30
+ - **Precision:** bf16 (bfloat16)
31
+ - **Dataset:** 6,567 training examples + 730 validation examples
32
+ - **Epochs:** 2
33
+ - **Effective Batch Size:** 16 (8 per device Γ— 2 gradient accumulation)
34
+ - **Learning Rate:** 2e-5 with cosine schedule
35
+ - **Optimizer:** AdamW (weight decay 0.01)
36
+ - **Training Time:** 38.1 minutes on NVIDIA H200
37
+ - **Peak VRAM:** 24.3 GB
38
 
39
+ ## Training Loss
40
 
41
+ ![Training Loss](lamp-gemma-4b-v2/graphs/training_loss.png)
42
 
43
+ ## Training Details
 
 
44
 
45
+ ![Training Details](lamp-gemma-4b-v2/graphs/training_details.png)
46
 
47
+ ## Summary
 
48
 
49
+ ![Training Summary](lamp-gemma-4b-v2/graphs/training_summary.png)
50
+
51
+ ## Usage
52
+
53
+ ### With Ollama (GGUF)
 
 
54
 
 
55
  ```bash
56
+ # Download the GGUF file and Modelfile from lamp-gemma-4b-v2-gguf/
57
+ ollama create lamp-gemma -f Modelfile
58
+ ollama run lamp-gemma "warm and cozy lighting"
59
+ ```
60
+
61
+ ### With Transformers (HuggingFace)
62
+
63
+ ```python
64
+ from transformers import AutoModelForCausalLM, AutoTokenizer
65
+
66
+ model = AutoModelForCausalLM.from_pretrained("MrMoeeee/lamp-models", subfolder="lamp-gemma-4b-v2")
67
+ tokenizer = AutoTokenizer.from_pretrained("MrMoeeee/lamp-models", subfolder="lamp-gemma-4b-v2")
68
  ```
69
 
70
+ ## Files
71
+
72
+ ```
73
+ lamp-gemma-4b-v2/ # Full model weights + training logs
74
+ β”œβ”€β”€ model-00001-of-00002.safetensors
75
+ β”œβ”€β”€ model-00002-of-00002.safetensors
76
+ β”œβ”€β”€ config.json
77
+ β”œβ”€β”€ tokenizer.json
78
+ β”œβ”€β”€ training_config.json
79
+ β”œβ”€β”€ training_log.json
80
+ β”œβ”€β”€ training_metrics.csv
81
+ β”œβ”€β”€ metrics_detailed.json
82
+ └── graphs/
83
+ β”œβ”€β”€ training_loss.png
84
+ β”œβ”€β”€ training_details.png
85
+ └── training_summary.png
86
+
87
+ lamp-gemma-4b-v2-gguf/ # Quantized GGUF for inference
88
+ β”œβ”€β”€ lamp-gemma-4b-v2-Q8_0.gguf
89
+ └── Modelfile
90
+ ```
91
 
92
+ ## Dataset
93
 
94
+ The LAMP dataset consists of natural language lighting requests paired with JSON lighting programs. Each program controls RGB LEDs with support for:
95
+ - Static colors and gradients
96
+ - Animations (breathing, rainbow, chase, etc.)
97
+ - Multi-step sequences with timing
98
+ - Brightness and speed control