Text Generation
Transformers
Safetensors
English
Ganda
gemma3_text
luganda
translation
conversational
gemma
gemma3
fine-tuned
text-generation-inference
Instructions to use CraneAILabs/ganda-gemma-1b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CraneAILabs/ganda-gemma-1b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CraneAILabs/ganda-gemma-1b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("CraneAILabs/ganda-gemma-1b") model = AutoModelForCausalLM.from_pretrained("CraneAILabs/ganda-gemma-1b", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CraneAILabs/ganda-gemma-1b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CraneAILabs/ganda-gemma-1b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CraneAILabs/ganda-gemma-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CraneAILabs/ganda-gemma-1b
- SGLang
How to use CraneAILabs/ganda-gemma-1b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "CraneAILabs/ganda-gemma-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CraneAILabs/ganda-gemma-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "CraneAILabs/ganda-gemma-1b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CraneAILabs/ganda-gemma-1b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use CraneAILabs/ganda-gemma-1b with Docker Model Runner:
docker model run hf.co/CraneAILabs/ganda-gemma-1b
Upload 3 files
Browse files- .gitattributes +1 -0
- EVALUATION.md +77 -0
- luganda_comprehensive_chart.png +3 -0
- luganda_results.csv +18 -0
.gitattributes
CHANGED
|
@@ -36,3 +36,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
ganda_gemma_ascending_chart.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
ganda_gemma_ascending_clean.png filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 36 |
tokenizer.json filter=lfs diff=lfs merge=lfs -text
|
| 37 |
ganda_gemma_ascending_chart.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
ganda_gemma_ascending_clean.png filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
luganda_comprehensive_chart.png filter=lfs diff=lfs merge=lfs -text
|
EVALUATION.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Comprehensive FLORES Translation Evaluation Results
|
| 2 |
+
|
| 3 |
+
## Overview
|
| 4 |
+
This package contains comprehensive evaluation results for English→Luganda and English→Swahili translation using the FLORES+ dataset. The evaluation includes specialized fine-tuned models, commercial services, and baseline models.
|
| 5 |
+
|
| 6 |
+
## Contents
|
| 7 |
+
|
| 8 |
+
### 📊 Charts (`/charts/`)
|
| 9 |
+
- `luganda_comprehensive_chart.png` - Complete Luganda translation performance comparison (17 models)
|
| 10 |
+
- `swahili_comprehensive_chart.png` - Complete Swahili translation performance comparison (16 models)
|
| 11 |
+
|
| 12 |
+
### 📈 Data (`/data/`)
|
| 13 |
+
- `luganda_results.csv` - Detailed Luganda evaluation results with rankings
|
| 14 |
+
- `swahili_results.csv` - Detailed Swahili evaluation results with rankings
|
| 15 |
+
- `summary.csv` - Executive summary of our models' performance
|
| 16 |
+
|
| 17 |
+
## Key Results
|
| 18 |
+
|
| 19 |
+
### 🏆 Our Models Performance
|
| 20 |
+
|
| 21 |
+
| Language | Model | Rank | BLEU | chrF++ | Percentile | Efficiency (BLEU/B) |
|
| 22 |
+
|----------|-------|------|------|--------|------------|---------------------|
|
| 23 |
+
| **Luganda** | Ganda Gemma 1B | 5/17 | 6.99 | 40.32 | 76.5% | 6.99 |
|
| 24 |
+
| **Swahili** | Swahili Gemma 1B | 12/16 | 27.59 | 56.84 | 31.2% | 27.59 |
|
| 25 |
+
|
| 26 |
+
### 🎯 Key Insights
|
| 27 |
+
|
| 28 |
+
**Language Resource Impact:**
|
| 29 |
+
- **Swahili** significantly outperforms **Luganda** (27.59 vs 6.99 BLEU)
|
| 30 |
+
- Reflects the resource availability gap between the two languages
|
| 31 |
+
- Demonstrates the challenge of low-resource language translation
|
| 32 |
+
|
| 33 |
+
**Competitive Standing:**
|
| 34 |
+
- **Luganda**: Ranks 5th out of 17 models (76.5th percentile)
|
| 35 |
+
- **Swahili**: Ranks 12th out of 16 models (31.2nd percentile)
|
| 36 |
+
- Both models show excellent parameter efficiency
|
| 37 |
+
|
| 38 |
+
**Baseline Comparison:**
|
| 39 |
+
- Our specialized models vastly outperform the general Gemma-3-1B baseline
|
| 40 |
+
- **Luganda**: 6.99 vs 0.51 BLEU (13.8x improvement)
|
| 41 |
+
- **Swahili**: 27.59 vs 2.78 BLEU (9.9x improvement)
|
| 42 |
+
|
| 43 |
+
## Methodology
|
| 44 |
+
|
| 45 |
+
**Dataset:** FLORES+ devtest split (1,012 sentence pairs per language)
|
| 46 |
+
**Metrics:** BLEU and chrF++ scores
|
| 47 |
+
**Evaluation:** Comprehensive comparison across 17 different models/services
|
| 48 |
+
**Baseline:** vLLM-served Gemma-3-1B-IT for fair comparison
|
| 49 |
+
|
| 50 |
+
## Models Evaluated
|
| 51 |
+
|
| 52 |
+
### Commercial Services
|
| 53 |
+
- Google Translate (top performer in both languages)
|
| 54 |
+
|
| 55 |
+
### Specialized Models (Ours)
|
| 56 |
+
- Ganda Gemma 1B (fine-tuned for Luganda)
|
| 57 |
+
- Swahili Gemma 1B (fine-tuned for Swahili)
|
| 58 |
+
|
| 59 |
+
### General Models
|
| 60 |
+
- Claude Sonnet 4, GPT variants, Gemini models, Llama models
|
| 61 |
+
- Gemma-3-1B baseline (vLLM)
|
| 62 |
+
|
| 63 |
+
## Files Description
|
| 64 |
+
|
| 65 |
+
### Data Files
|
| 66 |
+
- **CSV Structure**: Rank, Model, Type, Parameters (B), BLEU, chrF++, BLEU per Billion Params, Our Model
|
| 67 |
+
- **Rankings**: Sorted by BLEU score (descending)
|
| 68 |
+
- **Efficiency**: BLEU score per billion parameters for fair comparison
|
| 69 |
+
|
| 70 |
+
### Charts
|
| 71 |
+
- **Visual comparison** of all models with our models highlighted
|
| 72 |
+
- **Color coding**: Red (BLEU), Black (chrF++)
|
| 73 |
+
- **Special marking**: Diagonal stripes for our models
|
| 74 |
+
|
| 75 |
+
---
|
| 76 |
+
|
| 77 |
+
*Evaluation Framework: FLORES+ English→African Languages*
|
luganda_comprehensive_chart.png
ADDED
|
Git LFS Details
|
luganda_results.csv
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Rank,Model,Type,BLEU,chrF++,Our Model
|
| 2 |
+
1,Google Translate,Commercial Service,9.27,46.44,FALSE
|
| 3 |
+
2,Claude Sonnet 4,Anthropic,8.07,43.54,FALSE
|
| 4 |
+
3,Gemini 2.0 Flash 001,Google,7.94,43.38,FALSE
|
| 5 |
+
4,Gemini 2.5 Pro,Google,7.46,44.74,FALSE
|
| 6 |
+
5,Ganda Gemma 1B (Our Model),Specialized Fine-tuned,6.99,40.32,TRUE
|
| 7 |
+
6,Gemini 2.5 Flash,Google,6.28,40.51,FALSE
|
| 8 |
+
7,Chatgpt 4o Latest,OpenAI,6.19,40,FALSE
|
| 9 |
+
8,Gpt Oss 120B,OpenAI,5.16,34.7,FALSE
|
| 10 |
+
9,Gpt 5 Mini,OpenAI,5.14,36.55,FALSE
|
| 11 |
+
10,Gpt 5 Nano,OpenAI,4.93,32.86,FALSE
|
| 12 |
+
11,Llama 4 Maverick,Meta,4.52,33.75,FALSE
|
| 13 |
+
12,Gemma 3 27B,Google,3.65,31.37,FALSE
|
| 14 |
+
13,Llama 4 Scout,Meta,3.59,27.63,FALSE
|
| 15 |
+
14,Gpt Oss 20B,OpenAI,3.39,27.98,FALSE
|
| 16 |
+
15,Gemma 3 4B,Google,1.1,20.05,FALSE
|
| 17 |
+
16,Gemma 3N E4B,Google,0.84,17.6,FALSE
|
| 18 |
+
17,Gemma 3 1B (vLLM Baseline),General Model,0.51,9.79,FALSE
|