Bronsn commited on
Commit
a97d8b3
·
verified ·
1 Parent(s): 7fde75d

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,3 +1,233 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: crane-ai-labs/ganda-gemma-1b
3
+ language:
4
+ - en
5
+ - lg
6
+ library_name: transformers
7
+ license: gemma
8
+ tags:
9
+ - luganda
10
+ - translation
11
+ - conversational
12
+ - unsloth
13
+ - gemma
14
+ - gemma3
15
+ - gguf
16
+ - quantized
17
+ pipeline_tag: text-generation
18
+ ---
19
+
20
+ # Ganda Gemma 1B - GGUF
21
+
22
+ Quantized GGUF versions of **Ganda Gemma 1B**, a fine-tuned Gemma 3 1B instruction model specialized for **English-to-Luganda translation and Luganda conversational AI**. The model accepts input in both English and Luganda but outputs responses exclusively in Luganda.
23
+
24
+ ## 🚀 Quick Start
25
+
26
+ ```bash
27
+ # Download the recommended Q4_K_M quantization
28
+ pip install huggingface_hub
29
+
30
+ # Python download
31
+ from huggingface_hub import snapshot_download
32
+ snapshot_download(
33
+ repo_id="crane-ai-labs/ganda-gemma-1b-GGUF",
34
+ local_dir="ganda-gemma-1b-GGUF",
35
+ allow_patterns=["Q4_K_M/*"] # Download only Q4_K_M version
36
+ )
37
+ ```
38
+
39
+ ## 📊 Available Quantizations
40
+
41
+ | Quantization | Folder | File Size | Quality | Use Case |
42
+ |-------------|--------|-----------|---------|----------|
43
+ | `F32` | F32/ | ~2.4GB | Highest | Research & benchmarking |
44
+ | `F16` | F16/ | ~1.2GB | Highest | Maximum quality inference |
45
+ | `Q8_0` | Q8_0/ | ~600MB | Very High | Production with ample resources |
46
+ | `Q5_K_M` | Q5_K_M/ | ~500MB | High | Balanced quality/size |
47
+ | `Q4_K_M` | Q4_K_M/ | ~400MB | Good | **Recommended** for most users |
48
+ | `Q4_K_S` | Q4_K_S/ | ~350MB | Good | Resource-constrained environments |
49
+ | `Q3_K_M` | Q3_K_M/ | ~300MB | Fair | Mobile/edge deployment |
50
+ | `Q2_K` | Q2_K/ | ~250MB | Lower | Minimal resource usage |
51
+
52
+ ## 🌍 Model Capabilities
53
+
54
+ - **Input Languages**: English + Luganda
55
+ - **Output Language**: Luganda only
56
+ - **Specializations**:
57
+ - English-to-Luganda translation
58
+ - Luganda conversational AI
59
+ - Text summarization in Luganda
60
+ - Question answering in Luganda
61
+
62
+ ## 💻 Usage with llama.cpp
63
+
64
+ ### Download and Setup
65
+
66
+ ```bash
67
+ # Install llama.cpp
68
+ git clone https://github.com/ggerganov/llama.cpp
69
+ cd llama.cpp
70
+ make
71
+
72
+ # Download specific quantization
73
+ from huggingface_hub import snapshot_download
74
+ snapshot_download(
75
+ repo_id="crane-ai-labs/ganda-gemma-1b-GGUF",
76
+ local_dir="ganda-gemma-1b-GGUF",
77
+ allow_patterns=["Q4_K_M/*"]
78
+ )
79
+ ```
80
+
81
+ ### Basic Translation
82
+
83
+ ```bash
84
+ # English to Luganda translation
85
+ ./llama-cli \
86
+ --model ganda-gemma-1b-GGUF/Q4_K_M/ganda-gemma-1b-q4_k_m.gguf \
87
+ --prompt "Translate to Luganda: Hello, how are you today?" \
88
+ --temp 0.3 \
89
+ --top-p 0.95 \
90
+ --top-k 64 \
91
+ --repeat-penalty 1.1 \
92
+ -n 128
93
+ ```
94
+
95
+ ### Luganda Conversation
96
+
97
+ ```bash
98
+ # Chat in Luganda
99
+ ./llama-cli \
100
+ --model ganda-gemma-1b-GGUF/Q4_K_M/ganda-gemma-1b-q4_k_m.gguf \
101
+ --prompt "Mwasuze mutya! Nnyinza ntya okukuyamba leero?" \
102
+ --temp 0.3 \
103
+ --interactive
104
+ ```
105
+
106
+ ## 🔧 Usage with Ollama
107
+
108
+ ### Create Modelfile
109
+
110
+ ```dockerfile
111
+ # Save as Modelfile
112
+ FROM ganda-gemma-1b-GGUF/Q4_K_M/ganda-gemma-1b-q4_k_m.gguf
113
+
114
+ TEMPLATE """<start_of_turn>user
115
+ {{ .Prompt }}<end_of_turn>
116
+ <start_of_turn>model
117
+ """
118
+
119
+ PARAMETER temperature 0.3
120
+ PARAMETER top_p 0.95
121
+ PARAMETER top_k 64
122
+ PARAMETER repeat_penalty 1.1
123
+ PARAMETER num_ctx 4096
124
+
125
+ SYSTEM """You are a helpful AI assistant that specializes in English-to-Luganda translation and Luganda conversation. Always respond in Luganda."""
126
+ ```
127
+
128
+ ### Run with Ollama
129
+
130
+ ```bash
131
+ # Create model
132
+ ollama create ganda-gemma-1b -f Modelfile
133
+
134
+ # Use for translation
135
+ ollama run ganda-gemma-1b "Translate to Luganda: Good morning, how did you sleep?"
136
+
137
+ # Use for conversation
138
+ ollama run ganda-gemma-1b "Nkwagala nnyo okuyiga Oluganda. Oyinza okumperereza?"
139
+ ```
140
+
141
+ ## 📋 Download Specific Quantizations
142
+
143
+ ```python
144
+ from huggingface_hub import snapshot_download
145
+
146
+ # Download only F16 (highest quality)
147
+ snapshot_download(
148
+ repo_id="crane-ai-labs/ganda-gemma-1b-GGUF",
149
+ local_dir="ganda-gemma-1b-GGUF",
150
+ allow_patterns=["F16/*"]
151
+ )
152
+
153
+ # Download only Q2_K (smallest size)
154
+ snapshot_download(
155
+ repo_id="crane-ai-labs/ganda-gemma-1b-GGUF",
156
+ local_dir="ganda-gemma-1b-GGUF",
157
+ allow_patterns=["Q2_K/*"]
158
+ )
159
+
160
+ # Download multiple quantizations
161
+ snapshot_download(
162
+ repo_id="crane-ai-labs/ganda-gemma-1b-GGUF",
163
+ local_dir="ganda-gemma-1b-GGUF",
164
+ allow_patterns=["Q4_K_M/*", "Q8_0/*"]
165
+ )
166
+ ```
167
+
168
+ ## 🎯 Performance Metrics
169
+
170
+ **Translation Quality (BLEU Scores)**
171
+ - **Ganda Gemma 1B**: 6.98 BLEU, 40.63 chrF++
172
+ - **ChatGPT-4o-latest**: 6.46 BLEU, 39.98 chrF++
173
+ - **Llama-4-Maverick**: 4.29 BLEU, 33.52 chrF++
174
+
175
+ *Evaluated on 1,012 English-to-Luganda translation samples*
176
+
177
+ ## 🎨 Use Cases
178
+
179
+ - **Language Learning**: Practice English-Luganda translation
180
+ - **Cultural Preservation**: Create and document Luganda content
181
+ - **Educational Tools**: Luganda learning assistants
182
+ - **Content Localization**: Translate materials to Luganda
183
+ - **Conversational Practice**: Improve Luganda dialogue skills
184
+ - **Text Summarization**: Summarize content in Luganda
185
+
186
+ ## 💡 Generation Parameters
187
+
188
+ Recommended settings for optimal results:
189
+
190
+ ```yaml
191
+ temperature: 0.3 # Focused, coherent responses
192
+ top_p: 0.95 # Nucleus sampling
193
+ top_k: 64 # Top-k sampling
194
+ max_tokens: 128 # Response length limit
195
+ repeat_penalty: 1.1 # Reduces repetition
196
+ ```
197
+
198
+ ## 🔗 Related Models
199
+
200
+ - **Main Model**: [crane-ai-labs/ganda-gemma-1b](https://huggingface.co/crane-ai-labs/ganda-gemma-1b) - Original PyTorch model
201
+ - **Collection**: [Ganda Gemma 1B](https://huggingface.co/collections/crane-ai-labs/ganda-gemma-1b) - All model variants
202
+
203
+ ## ⚠️ Limitations
204
+
205
+ - **Language Output**: Responds only in Luganda
206
+ - **Factual Knowledge**: General knowledge only, not trained on specific factual datasets
207
+ - **No Coding/Math**: Not designed for programming or mathematical tasks
208
+ - **Context Length**: Limited to 4,096 tokens for optimal performance
209
+ - **Specialized Domains**: May require domain-specific fine-tuning
210
+
211
+ ## 🤝 Training Details
212
+
213
+ - **Base Model**: Gemma 3 1B Instruction Tuned
214
+ - **Training Method**: GRPO (Generalized Reward Preference Optimization)
215
+ - **Context Length**: 4,096 tokens
216
+ - **Architecture**: Transformer with sliding window attention
217
+ - **Tokenizer**: SentencePiece with 262K vocabulary
218
+
219
+ ## 📄 License
220
+
221
+ This model is released under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Please review the terms before use.
222
+
223
+ ## 🙏 Acknowledgments
224
+
225
+ - **Google**: For the Gemma 3 base model
226
+ - **Unsloth**: For quantization techniques and methodology
227
+ - **Community**: For Luganda language resources and datasets
228
+
229
+ ---
230
+
231
+ **Built with ❤️ by Crane AI Labs**
232
+
233
+ *Ganda Gemma - Your helpful Luganda AI companion*
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "<image_soft_token>": 262144
3
+ }
chat_template.jinja ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {{ bos_token }}
2
+ {%- if messages[0]['role'] == 'system' -%}
3
+ {%- if messages[0]['content'] is string -%}
4
+ {%- set first_user_prefix = messages[0]['content'] + '
5
+
6
+ ' -%}
7
+ {%- else -%}
8
+ {%- set first_user_prefix = messages[0]['content'][0]['text'] + '
9
+
10
+ ' -%}
11
+ {%- endif -%}
12
+ {%- set loop_messages = messages[1:] -%}
13
+ {%- else -%}
14
+ {%- set first_user_prefix = "" -%}
15
+ {%- set loop_messages = messages -%}
16
+ {%- endif -%}
17
+ {%- for message in loop_messages -%}
18
+ {%- if (message['role'] == 'user') != (loop.index0 % 2 == 0) -%}
19
+ {{ raise_exception("Conversation roles must alternate user/assistant/user/assistant/...") }}
20
+ {%- endif -%}
21
+ {%- if (message['role'] == 'assistant') -%}
22
+ {%- set role = "model" -%}
23
+ {%- else -%}
24
+ {%- set role = message['role'] -%}
25
+ {%- endif -%}
26
+ {{ '<start_of_turn>' + role + '
27
+ ' + (first_user_prefix if loop.first else "") }}
28
+ {%- if message['content'] is string -%}
29
+ {{ message['content'] | trim }}
30
+ {%- elif message['content'] is iterable -%}
31
+ {%- for item in message['content'] -%}
32
+ {%- if item['type'] == 'image' -%}
33
+ {{ '<start_of_image>' }}
34
+ {%- elif item['type'] == 'text' -%}
35
+ {{ item['text'] | trim }}
36
+ {%- endif -%}
37
+ {%- endfor -%}
38
+ {%- else -%}
39
+ {{ raise_exception("Invalid content type") }}
40
+ {%- endif -%}
41
+ {{ '<end_of_turn>
42
+ ' }}
43
+ {%- endfor -%}
44
+ {%- if add_generation_prompt -%}
45
+ {{ '<start_of_turn>model
46
+ ' }}
47
+ {%- endif -%}
config.json ADDED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_sliding_window_pattern": 6,
3
+ "architectures": [
4
+ "Gemma3ForCausalLM"
5
+ ],
6
+ "attention_bias": false,
7
+ "attention_dropout": 0.0,
8
+ "attn_logit_softcapping": null,
9
+ "bos_token_id": 2,
10
+ "cache_implementation": "hybrid",
11
+ "eos_token_id": 106,
12
+ "final_logit_softcapping": null,
13
+ "head_dim": 256,
14
+ "hidden_activation": "gelu_pytorch_tanh",
15
+ "hidden_size": 1152,
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 6912,
18
+ "layer_types": [
19
+ "sliding_attention",
20
+ "sliding_attention",
21
+ "sliding_attention",
22
+ "sliding_attention",
23
+ "sliding_attention",
24
+ "full_attention",
25
+ "sliding_attention",
26
+ "sliding_attention",
27
+ "sliding_attention",
28
+ "sliding_attention",
29
+ "sliding_attention",
30
+ "full_attention",
31
+ "sliding_attention",
32
+ "sliding_attention",
33
+ "sliding_attention",
34
+ "sliding_attention",
35
+ "sliding_attention",
36
+ "full_attention",
37
+ "sliding_attention",
38
+ "sliding_attention",
39
+ "sliding_attention",
40
+ "sliding_attention",
41
+ "sliding_attention",
42
+ "full_attention",
43
+ "sliding_attention",
44
+ "sliding_attention"
45
+ ],
46
+ "max_position_embeddings": 32768,
47
+ "model_type": "gemma3_text",
48
+ "num_attention_heads": 4,
49
+ "num_hidden_layers": 26,
50
+ "num_key_value_heads": 1,
51
+ "pad_token_id": 0,
52
+ "query_pre_attn_scalar": 256,
53
+ "rms_norm_eps": 1e-06,
54
+ "rope_local_base_freq": 10000,
55
+ "rope_scaling": null,
56
+ "rope_theta": 1000000,
57
+ "sliding_window": 512,
58
+ "torch_dtype": "bfloat16",
59
+ "transformers_version": "4.54.1",
60
+ "unsloth_fixed": true,
61
+ "unsloth_version": "2025.7.11",
62
+ "use_cache": true,
63
+ "vocab_size": 262144
64
+ }
generation_config.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token_id": 2,
3
+ "cache_implementation": "hybrid",
4
+ "do_sample": true,
5
+ "eos_token_id": [
6
+ 1,
7
+ 106
8
+ ],
9
+ "max_length": 32768,
10
+ "pad_token_id": 0,
11
+ "top_k": 64,
12
+ "top_p": 0.95,
13
+ "transformers_version": "4.54.1"
14
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c23f49045a133162ef10793f5ea7f6eadc0d2802c66ac53f9b191f117481d3a9
3
+ size 1999811208
special_tokens_map.json ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "boi_token": "<start_of_image>",
3
+ "bos_token": {
4
+ "content": "<bos>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false
9
+ },
10
+ "eoi_token": "<end_of_image>",
11
+ "eos_token": {
12
+ "content": "<end_of_turn>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false
17
+ },
18
+ "image_token": "<image_soft_token>",
19
+ "pad_token": {
20
+ "content": "<pad>",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false
25
+ },
26
+ "unk_token": {
27
+ "content": "<unk>",
28
+ "lstrip": false,
29
+ "normalized": false,
30
+ "rstrip": false,
31
+ "single_word": false
32
+ }
33
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d786405177734910d7a3db625c2826640964a0b4e5cdbbd70620ae3313a01bef
3
+ size 33384722
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1299c11d7cf632ef3b4e11937501358ada021bbdf7c47638d13c0ee982f2e79c
3
+ size 4689074
tokenizer_config.json ADDED
The diff for this file is too large to render. See raw diff