Add sunflower GGUF quantized models
Browse files- .gitattributes +9 -0
- .ipynb_checkpoints/README-checkpoint.md +229 -0
- Modelfile +22 -0
- README.md +229 -0
- sunflower-32B-f16.gguf +3 -0
- sunflower-32B-iq1_s.gguf +3 -0
- sunflower-32B-iq2_xxs.gguf +3 -0
- sunflower-32B-q4_k_m.gguf +3 -0
- sunflower-32B-q5_k_m.gguf +3 -0
- sunflower-32B-q6_k.gguf +3 -0
- sunflower-32B-q8_0.gguf +3 -0
- sunflower-32B-tq1_0.gguf +3 -0
- sunflower-imatrix.dat +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,12 @@ 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 |
+
sunflower-32B-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
sunflower-32B-iq1_s.gguf filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
sunflower-32B-iq2_xxs.gguf filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
sunflower-32B-q4_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
sunflower-32B-q5_k_m.gguf filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
sunflower-32B-q6_k.gguf filter=lfs diff=lfs merge=lfs -text
|
| 42 |
+
sunflower-32B-q8_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 43 |
+
sunflower-32B-tq1_0.gguf filter=lfs diff=lfs merge=lfs -text
|
| 44 |
+
sunflower-imatrix.dat filter=lf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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Sunbird/Sunflower-32B
|
| 4 |
+
tags:
|
| 5 |
+
- quantized
|
| 6 |
+
- gguf
|
| 7 |
+
- llama.cpp
|
| 8 |
+
- ollama
|
| 9 |
+
- ugandan-languages
|
| 10 |
+
- translation
|
| 11 |
+
- qwen
|
| 12 |
+
library_name: transformers
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
- lg
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Sunflower 32B - GGUF
|
| 20 |
+
|
| 21 |
+
GGUF quantized versions of the Sunflower model for Ugandan language translation tasks.
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
- **Base Model**: [Sunbird/Sunflower-32B](https://huggingface.co/Sunbird/Sunflower-32B)
|
| 26 |
+
- **Model Size**: 32B parameters
|
| 27 |
+
- **Architecture**: Qwen2.5
|
| 28 |
+
- **Quantization**: K-means quantization with importance matrix
|
| 29 |
+
- **Languages**: English, Luganda, and other Ugandan languages
|
| 30 |
+
|
| 31 |
+
## Available Files
|
| 32 |
+
|
| 33 |
+
### Recommended Quantizations
|
| 34 |
+
|
| 35 |
+
| Filename | Quant type | File Size | Description |
|
| 36 |
+
| -------- | ---------- | --------- | ----------- |
|
| 37 |
+
| sunflower-32B-f16.gguf | F16 | 62GB | Original precision |
|
| 38 |
+
| sunflower-32B-q8_0.gguf | Q8_0 | 33GB | Highest quality quantized |
|
| 39 |
+
| sunflower-32B-q6_k.gguf | Q6_K | 26GB | High quality |
|
| 40 |
+
| sunflower-32B-q5_k_m.gguf | Q5_K_M | 22GB | Balanced quality/size |
|
| 41 |
+
| sunflower-32B-q5_k_s.gguf | Q5_K_S | 19GB | Smaller Q5 variant |
|
| 42 |
+
| sunflower-32B-q4_k_m.gguf | Q4_K_M | 17GB | **Recommended for most users** |
|
| 43 |
+
|
| 44 |
+
### Warning: Experimental Quantizations
|
| 45 |
+
|
| 46 |
+
The following quantizations achieve extreme compression but may significantly impact translation quality. Use for research and experimentation only.
|
| 47 |
+
|
| 48 |
+
| Filename | Quant type | File Size | Compression | Warning |
|
| 49 |
+
| -------- | ---------- | --------- | ----------- | ------- |
|
| 50 |
+
| sunflower-32B-iq2_xxs.gguf | IQ2_XXS | 8.5GB | 85% smaller | May lose translation accuracy |
|
| 51 |
+
| sunflower-32B-tq1_0.gguf | TQ1_0 | 7.2GB | 87% smaller | Experimental ternary quantization |
|
| 52 |
+
| sunflower-32B-iq1_s.gguf | IQ1_S | 6.9GB | 88% smaller | **Extreme compression, quality heavily impacted** |
|
| 53 |
+
|
| 54 |
+
**Note**: The experimental quantizations (IQ1_S, IQ2_XXS, TQ1_0) use advanced compression techniques that may not preserve the specialized knowledge for Ugandan language translation. Test thoroughly before production use.
|
| 55 |
+
|
| 56 |
+
### Additional Files
|
| 57 |
+
|
| 58 |
+
| Filename | Description |
|
| 59 |
+
| -------- | ----------- |
|
| 60 |
+
| sunflower-imatrix.dat | Importance matrix data used for quantization |
|
| 61 |
+
|
| 62 |
+
## Usage
|
| 63 |
+
|
| 64 |
+
### llama.cpp
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
# Download model
|
| 68 |
+
huggingface-cli download Sunbird/Sunflower-32B-GGUF sunflower-32B-q4_k_m.gguf --local-dir .
|
| 69 |
+
|
| 70 |
+
# Run inference
|
| 71 |
+
./llama-cli -m sunflower-32B-q4_k_m.gguf -p "Translate to Luganda: Hello, how are you today?"
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## Ollama Integration
|
| 75 |
+
|
| 76 |
+
Ollama provides an easy way to run your quantized models locally with a simple API interface.
|
| 77 |
+
|
| 78 |
+
### Installation and Setup
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
# Install Ollama (Linux/macOS)
|
| 82 |
+
curl -fsSL https://ollama.ai/install.sh | sh
|
| 83 |
+
|
| 84 |
+
# Or download from https://ollama.ai for Windows
|
| 85 |
+
|
| 86 |
+
# Start Ollama service (runs in background)
|
| 87 |
+
ollama serve
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
### Creating Modelfiles for Different Quantizations
|
| 91 |
+
|
| 92 |
+
**Q4_K_M (Recommended) - Modelfile:**
|
| 93 |
+
```bash
|
| 94 |
+
cat > Modelfile.q4 << 'EOF'
|
| 95 |
+
FROM ./gguf_outputs/model-q4_k_m.gguf
|
| 96 |
+
|
| 97 |
+
# System prompt for your specific use case
|
| 98 |
+
SYSTEM """You are a linguist and translator specializing in Ugandan languages, made by Sunbird AI."""
|
| 99 |
+
|
| 100 |
+
# Chat template (adjust for your base model architecture)
|
| 101 |
+
TEMPLATE """<|im_start|>system
|
| 102 |
+
{{ .System }}<|im_end|>
|
| 103 |
+
<|im_start|>user
|
| 104 |
+
{{ .Prompt }}<|im_end|>
|
| 105 |
+
<|im_start|>assistant
|
| 106 |
+
{{ .Response }}<|im_end|>"""
|
| 107 |
+
|
| 108 |
+
# Stop tokens
|
| 109 |
+
PARAMETER stop "<|im_start|>"
|
| 110 |
+
PARAMETER stop "<|im_end|>"
|
| 111 |
+
|
| 112 |
+
# Generation parameters
|
| 113 |
+
PARAMETER temperature 0.3
|
| 114 |
+
PARAMETER top_p 0.95
|
| 115 |
+
PARAMETER top_k 40
|
| 116 |
+
PARAMETER repeat_penalty 1.1
|
| 117 |
+
PARAMETER num_ctx 4096
|
| 118 |
+
PARAMETER num_predict 500
|
| 119 |
+
EOF
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
**Experimental IQ1_S - Modelfile:**
|
| 123 |
+
```bash
|
| 124 |
+
cat > Modelfile.iq1s << 'EOF'
|
| 125 |
+
FROM ./gguf_outputs/model-iq1_s.gguf
|
| 126 |
+
|
| 127 |
+
SYSTEM """You are a translator for Ugandan languages. Note: This is an experimental ultra-compressed model - quality may be limited."""
|
| 128 |
+
|
| 129 |
+
# Same template and parameters as above
|
| 130 |
+
TEMPLATE """<|im_start|>system
|
| 131 |
+
{{ .System }}<|im_end|>
|
| 132 |
+
<|im_start|>user
|
| 133 |
+
{{ .Prompt }}<|im_end|>
|
| 134 |
+
<|im_start|>assistant
|
| 135 |
+
{{ .Response }}<|im_end|>"""
|
| 136 |
+
|
| 137 |
+
PARAMETER stop "<|im_start|>"
|
| 138 |
+
PARAMETER stop "<|im_end|>"
|
| 139 |
+
PARAMETER temperature 0.3
|
| 140 |
+
PARAMETER top_p 0.95
|
| 141 |
+
PARAMETER num_ctx 2048 # Smaller context for experimental model
|
| 142 |
+
EOF
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
### Importing Models to Ollama
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
# Import Q4_K_M model (recommended)
|
| 149 |
+
ollama create sunflower-32B:q4 -f Modelfile.q4
|
| 150 |
+
|
| 151 |
+
# Import experimental IQ1_S model
|
| 152 |
+
ollama create sunflower-32B:iq1s -f Modelfile.iq1s
|
| 153 |
+
|
| 154 |
+
# Import other quantizations
|
| 155 |
+
ollama create sunflower-32B:q5 -f Modelfile.q5
|
| 156 |
+
ollama create sunflower-32B:q6 -f Modelfile.q6
|
| 157 |
+
|
| 158 |
+
# Verify models are imported
|
| 159 |
+
ollama list
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
**Expected output:**
|
| 163 |
+
```
|
| 164 |
+
NAME ID SIZE MODIFIED
|
| 165 |
+
sunflower-32B:q4 abc123def 17GB 2 minutes ago
|
| 166 |
+
sunflower-32B:iq1s def456ghi 6.2GB 1 minute ago
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
### Using Ollama Models
|
| 170 |
+
|
| 171 |
+
**Interactive Chat:**
|
| 172 |
+
```bash
|
| 173 |
+
# Start interactive session with Q4 model
|
| 174 |
+
ollama run sunflower-32B:q4
|
| 175 |
+
|
| 176 |
+
# Example conversation:
|
| 177 |
+
# >>> Translate to Luganda: Hello, how are you today?
|
| 178 |
+
# >>> Give a dictionary definition of the Samia term "ovulwaye" in English
|
| 179 |
+
# >>> /bye (to exit)
|
| 180 |
+
|
| 181 |
+
# Start with experimental model
|
| 182 |
+
ollama run sunflower-32B:iq1s
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
**Single Prompt Inference:**
|
| 186 |
+
```bash
|
| 187 |
+
# Quick translation with Q4 model
|
| 188 |
+
ollama run sunflower-32B:q4 "Translate to Luganda: People in villages rarely accept new technologies."
|
| 189 |
+
|
| 190 |
+
# Test experimental model
|
| 191 |
+
ollama run sunflower-32B:iq1s "Translate to Luganda: Good morning"
|
| 192 |
+
|
| 193 |
+
# Dictionary definition
|
| 194 |
+
ollama run sunflower-32B:q4 'Give a dictionary definition of the Samia term "ovulwaye" in English'
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
### Ollama API Usage
|
| 198 |
+
|
| 199 |
+
**Start API Server:**
|
| 200 |
+
```bash
|
| 201 |
+
# Ollama automatically serves API on http://localhost:11434
|
| 202 |
+
# Test API endpoint
|
| 203 |
+
curl http://localhost:11434/api/version
|
| 204 |
+
```
|
| 205 |
+
|
| 206 |
+
### Python (llama-cpp-python)
|
| 207 |
+
|
| 208 |
+
```python
|
| 209 |
+
from llama_cpp import Llama
|
| 210 |
+
|
| 211 |
+
llm = Llama(model_path="sunflower-32B-q4_k_m.gguf")
|
| 212 |
+
result = llm("Translate to Luganda: How are you?")
|
| 213 |
+
print(result['choices'][0]['text'])
|
| 214 |
+
```
|
| 215 |
+
|
| 216 |
+
## Performance Notes
|
| 217 |
+
|
| 218 |
+
- **Q4_K_M**: Recommended for most use cases
|
| 219 |
+
- **Q5_K_M**: Better quality with moderate size increase
|
| 220 |
+
- **Q6_K**: High quality for production use
|
| 221 |
+
- **Q8_0**: Near-lossless quality
|
| 222 |
+
|
| 223 |
+
## Technical Details
|
| 224 |
+
|
| 225 |
+
Quantized using llama.cpp with importance matrix calibration for optimal quality preservation.
|
| 226 |
+
|
| 227 |
+
## License
|
| 228 |
+
|
| 229 |
+
Apache 2.0
|
Modelfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM sunflower-32B-q4_k_m.gguf
|
| 2 |
+
|
| 3 |
+
# System message
|
| 4 |
+
SYSTEM """You are a linguist and translator specialising in Ugandan languages, made by Sunbird AI."""
|
| 5 |
+
|
| 6 |
+
TEMPLATE """<|im_start|>system
|
| 7 |
+
{{ .System }}<|im_end|>
|
| 8 |
+
<|im_start|>user
|
| 9 |
+
{{ .Prompt }}<|im_end|>
|
| 10 |
+
<|im_start|>assistant
|
| 11 |
+
{{ .Response }}<|im_end|>"""
|
| 12 |
+
|
| 13 |
+
# Stop tokens
|
| 14 |
+
PARAMETER stop "<|im_start|>"
|
| 15 |
+
PARAMETER stop "<|im_end|>"
|
| 16 |
+
|
| 17 |
+
# Quality parameters
|
| 18 |
+
PARAMETER temperature 0.3
|
| 19 |
+
PARAMETER top_p 0.95
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
base_model: Sunbird/Sunflower-32B
|
| 4 |
+
tags:
|
| 5 |
+
- quantized
|
| 6 |
+
- gguf
|
| 7 |
+
- llama.cpp
|
| 8 |
+
- ollama
|
| 9 |
+
- ugandan-languages
|
| 10 |
+
- translation
|
| 11 |
+
- qwen
|
| 12 |
+
library_name: transformers
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
language:
|
| 15 |
+
- en
|
| 16 |
+
- lg
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Sunflower 32B - GGUF
|
| 20 |
+
|
| 21 |
+
GGUF quantized versions of the Sunflower model for Ugandan language translation tasks.
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
- **Base Model**: [Sunbird/Sunflower-32B](https://huggingface.co/Sunbird/Sunflower-32B)
|
| 26 |
+
- **Model Size**: 32B parameters
|
| 27 |
+
- **Architecture**: Qwen2.5
|
| 28 |
+
- **Quantization**: K-means quantization with importance matrix
|
| 29 |
+
- **Languages**: English, Luganda, and other Ugandan languages
|
| 30 |
+
|
| 31 |
+
## Available Files
|
| 32 |
+
|
| 33 |
+
### Recommended Quantizations
|
| 34 |
+
|
| 35 |
+
| Filename | Quant type | File Size | Description |
|
| 36 |
+
| -------- | ---------- | --------- | ----------- |
|
| 37 |
+
| sunflower-32B-f16.gguf | F16 | 62GB | Original precision |
|
| 38 |
+
| sunflower-32B-q8_0.gguf | Q8_0 | 33GB | Highest quality quantized |
|
| 39 |
+
| sunflower-32B-q6_k.gguf | Q6_K | 26GB | High quality |
|
| 40 |
+
| sunflower-32B-q5_k_m.gguf | Q5_K_M | 22GB | Balanced quality/size |
|
| 41 |
+
| sunflower-32B-q5_k_s.gguf | Q5_K_S | 19GB | Smaller Q5 variant |
|
| 42 |
+
| sunflower-32B-q4_k_m.gguf | Q4_K_M | 17GB | **Recommended for most users** |
|
| 43 |
+
|
| 44 |
+
### Warning: Experimental Quantizations
|
| 45 |
+
|
| 46 |
+
The following quantizations achieve extreme compression but may significantly impact translation quality. Use for research and experimentation only.
|
| 47 |
+
|
| 48 |
+
| Filename | Quant type | File Size | Compression | Warning |
|
| 49 |
+
| -------- | ---------- | --------- | ----------- | ------- |
|
| 50 |
+
| sunflower-32B-iq2_xxs.gguf | IQ2_XXS | 8.5GB | 85% smaller | May lose translation accuracy |
|
| 51 |
+
| sunflower-32B-tq1_0.gguf | TQ1_0 | 7.2GB | 87% smaller | Experimental ternary quantization |
|
| 52 |
+
| sunflower-32B-iq1_s.gguf | IQ1_S | 6.9GB | 88% smaller | **Extreme compression, quality heavily impacted** |
|
| 53 |
+
|
| 54 |
+
**Note**: The experimental quantizations (IQ1_S, IQ2_XXS, TQ1_0) use advanced compression techniques that may not preserve the specialized knowledge for Ugandan language translation. Test thoroughly before production use.
|
| 55 |
+
|
| 56 |
+
### Additional Files
|
| 57 |
+
|
| 58 |
+
| Filename | Description |
|
| 59 |
+
| -------- | ----------- |
|
| 60 |
+
| sunflower-imatrix.dat | Importance matrix data used for quantization |
|
| 61 |
+
|
| 62 |
+
## Usage
|
| 63 |
+
|
| 64 |
+
### llama.cpp
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
# Download model
|
| 68 |
+
huggingface-cli download Sunbird/Sunflower-32B-GGUF sunflower-32B-q4_k_m.gguf --local-dir .
|
| 69 |
+
|
| 70 |
+
# Run inference
|
| 71 |
+
./llama-cli -m sunflower-32B-q4_k_m.gguf -p "Translate to Luganda: Hello, how are you today?"
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## Ollama Integration
|
| 75 |
+
|
| 76 |
+
Ollama provides an easy way to run your quantized models locally with a simple API interface.
|
| 77 |
+
|
| 78 |
+
### Installation and Setup
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
# Install Ollama (Linux/macOS)
|
| 82 |
+
curl -fsSL https://ollama.ai/install.sh | sh
|
| 83 |
+
|
| 84 |
+
# Or download from https://ollama.ai for Windows
|
| 85 |
+
|
| 86 |
+
# Start Ollama service (runs in background)
|
| 87 |
+
ollama serve
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
### Creating Modelfiles for Different Quantizations
|
| 91 |
+
|
| 92 |
+
**Q4_K_M (Recommended) - Modelfile:**
|
| 93 |
+
```bash
|
| 94 |
+
cat > Modelfile.q4 << 'EOF'
|
| 95 |
+
FROM ./gguf_outputs/model-q4_k_m.gguf
|
| 96 |
+
|
| 97 |
+
# System prompt for your specific use case
|
| 98 |
+
SYSTEM """You are a linguist and translator specializing in Ugandan languages, made by Sunbird AI."""
|
| 99 |
+
|
| 100 |
+
# Chat template (adjust for your base model architecture)
|
| 101 |
+
TEMPLATE """<|im_start|>system
|
| 102 |
+
{{ .System }}<|im_end|>
|
| 103 |
+
<|im_start|>user
|
| 104 |
+
{{ .Prompt }}<|im_end|>
|
| 105 |
+
<|im_start|>assistant
|
| 106 |
+
{{ .Response }}<|im_end|>"""
|
| 107 |
+
|
| 108 |
+
# Stop tokens
|
| 109 |
+
PARAMETER stop "<|im_start|>"
|
| 110 |
+
PARAMETER stop "<|im_end|>"
|
| 111 |
+
|
| 112 |
+
# Generation parameters
|
| 113 |
+
PARAMETER temperature 0.3
|
| 114 |
+
PARAMETER top_p 0.95
|
| 115 |
+
PARAMETER top_k 40
|
| 116 |
+
PARAMETER repeat_penalty 1.1
|
| 117 |
+
PARAMETER num_ctx 4096
|
| 118 |
+
PARAMETER num_predict 500
|
| 119 |
+
EOF
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
**Experimental IQ1_S - Modelfile:**
|
| 123 |
+
```bash
|
| 124 |
+
cat > Modelfile.iq1s << 'EOF'
|
| 125 |
+
FROM ./gguf_outputs/model-iq1_s.gguf
|
| 126 |
+
|
| 127 |
+
SYSTEM """You are a translator for Ugandan languages. Note: This is an experimental ultra-compressed model - quality may be limited."""
|
| 128 |
+
|
| 129 |
+
# Same template and parameters as above
|
| 130 |
+
TEMPLATE """<|im_start|>system
|
| 131 |
+
{{ .System }}<|im_end|>
|
| 132 |
+
<|im_start|>user
|
| 133 |
+
{{ .Prompt }}<|im_end|>
|
| 134 |
+
<|im_start|>assistant
|
| 135 |
+
{{ .Response }}<|im_end|>"""
|
| 136 |
+
|
| 137 |
+
PARAMETER stop "<|im_start|>"
|
| 138 |
+
PARAMETER stop "<|im_end|>"
|
| 139 |
+
PARAMETER temperature 0.3
|
| 140 |
+
PARAMETER top_p 0.95
|
| 141 |
+
PARAMETER num_ctx 2048 # Smaller context for experimental model
|
| 142 |
+
EOF
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
### Importing Models to Ollama
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
# Import Q4_K_M model (recommended)
|
| 149 |
+
ollama create sunflower-32B:q4 -f Modelfile.q4
|
| 150 |
+
|
| 151 |
+
# Import experimental IQ1_S model
|
| 152 |
+
ollama create sunflower-32B:iq1s -f Modelfile.iq1s
|
| 153 |
+
|
| 154 |
+
# Import other quantizations
|
| 155 |
+
ollama create sunflower-32B:q5 -f Modelfile.q5
|
| 156 |
+
ollama create sunflower-32B:q6 -f Modelfile.q6
|
| 157 |
+
|
| 158 |
+
# Verify models are imported
|
| 159 |
+
ollama list
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
**Expected output:**
|
| 163 |
+
```
|
| 164 |
+
NAME ID SIZE MODIFIED
|
| 165 |
+
sunflower-32B:q4 abc123def 17GB 2 minutes ago
|
| 166 |
+
sunflower-32B:iq1s def456ghi 6.2GB 1 minute ago
|
| 167 |
+
```
|
| 168 |
+
|
| 169 |
+
### Using Ollama Models
|
| 170 |
+
|
| 171 |
+
**Interactive Chat:**
|
| 172 |
+
```bash
|
| 173 |
+
# Start interactive session with Q4 model
|
| 174 |
+
ollama run sunflower-32B:q4
|
| 175 |
+
|
| 176 |
+
# Example conversation:
|
| 177 |
+
# >>> Translate to Luganda: Hello, how are you today?
|
| 178 |
+
# >>> Give a dictionary definition of the Samia term "ovulwaye" in English
|
| 179 |
+
# >>> /bye (to exit)
|
| 180 |
+
|
| 181 |
+
# Start with experimental model
|
| 182 |
+
ollama run sunflower-32B:iq1s
|
| 183 |
+
```
|
| 184 |
+
|
| 185 |
+
**Single Prompt Inference:**
|
| 186 |
+
```bash
|
| 187 |
+
# Quick translation with Q4 model
|
| 188 |
+
ollama run sunflower-32B:q4 "Translate to Luganda: People in villages rarely accept new technologies."
|
| 189 |
+
|
| 190 |
+
# Test experimental model
|
| 191 |
+
ollama run sunflower-32B:iq1s "Translate to Luganda: Good morning"
|
| 192 |
+
|
| 193 |
+
# Dictionary definition
|
| 194 |
+
ollama run sunflower-32B:q4 'Give a dictionary definition of the Samia term "ovulwaye" in English'
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
### Ollama API Usage
|
| 198 |
+
|
| 199 |
+
**Start API Server:**
|
| 200 |
+
```bash
|
| 201 |
+
# Ollama automatically serves API on http://localhost:11434
|
| 202 |
+
# Test API endpoint
|
| 203 |
+
curl http://localhost:11434/api/version
|
| 204 |
+
```
|
| 205 |
+
|
| 206 |
+
### Python (llama-cpp-python)
|
| 207 |
+
|
| 208 |
+
```python
|
| 209 |
+
from llama_cpp import Llama
|
| 210 |
+
|
| 211 |
+
llm = Llama(model_path="sunflower-32B-q4_k_m.gguf")
|
| 212 |
+
result = llm("Translate to Luganda: How are you?")
|
| 213 |
+
print(result['choices'][0]['text'])
|
| 214 |
+
```
|
| 215 |
+
|
| 216 |
+
## Performance Notes
|
| 217 |
+
|
| 218 |
+
- **Q4_K_M**: Recommended for most use cases
|
| 219 |
+
- **Q5_K_M**: Better quality with moderate size increase
|
| 220 |
+
- **Q6_K**: High quality for production use
|
| 221 |
+
- **Q8_0**: Near-lossless quality
|
| 222 |
+
|
| 223 |
+
## Technical Details
|
| 224 |
+
|
| 225 |
+
Quantized using llama.cpp with importance matrix calibration for optimal quality preservation.
|
| 226 |
+
|
| 227 |
+
## License
|
| 228 |
+
|
| 229 |
+
Apache 2.0
|
sunflower-32B-f16.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7f3bf11bf1a48d518c87c3470befa60da2938425248cd01b0d7355ac0d45cb81
|
| 3 |
+
size 65531574880
|
sunflower-32B-iq1_s.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:855902c52f3751e8e7213ba2d4afa4ba1730cdfd0f8765892e7eb79ad29db26e
|
| 3 |
+
size 7323841344
|
sunflower-32B-iq2_xxs.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6d177208ccd8e903dc45eae108ad7f0c08ee0df1afcd43e2430d617787668ba3
|
| 3 |
+
size 9019913024
|
sunflower-32B-q4_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d98ed70da6013450d481e97294f1f9b9a1ee2f31681db372977e821b5a62ecc7
|
| 3 |
+
size 19762149184
|
sunflower-32B-q5_k_m.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4da275836c43b8c953dfe67b69ce5ec4b57ae4c155c2d2462a7cd777967801d6
|
| 3 |
+
size 23214831424
|
sunflower-32B-q6_k.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:921283b7f6888ef90668109cc25d3ef5df64fc6fc97a617e22b3e6cd61c27ac7
|
| 3 |
+
size 26883306304
|
sunflower-32B-q8_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08e6fd7d168fa19792dd73d5970ea382f234d99bac7602acf180cc53bdd2a079
|
| 3 |
+
size 34817719104
|
sunflower-32B-tq1_0.gguf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7aef9f35a47f64c19f7c9312bbfd5a169ffcd42ec05251e576e662415170eeac
|
| 3 |
+
size 7666825024
|
sunflower-imatrix.dat
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2e2039b5eddef2933fcfb8258bb12478c25157142e49861e301adbd3c147947b
|
| 3 |
+
size 15273216
|