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
Update README.md
Browse files
README.md
CHANGED
|
@@ -159,19 +159,6 @@ generation_config = {
|
|
| 159 |
- **Conversational Practice**: Improve Luganda dialogue skills
|
| 160 |
- **Text Summarization**: Summarize content in Luganda
|
| 161 |
|
| 162 |
-
## 💻 System Requirements
|
| 163 |
-
|
| 164 |
-
### Minimum Requirements
|
| 165 |
-
- **RAM**: 4GB+ for inference
|
| 166 |
-
- **Storage**: 3GB+ available space
|
| 167 |
-
- **Python**: 3.8+
|
| 168 |
-
- **PyTorch**: 1.9+
|
| 169 |
-
|
| 170 |
-
### Recommended Requirements
|
| 171 |
-
- **RAM**: 8GB+ for optimal performance
|
| 172 |
-
- **GPU**: 4GB+ VRAM for faster inference
|
| 173 |
-
- **Storage**: 5GB+ available space
|
| 174 |
-
|
| 175 |
## ⚠️ Limitations
|
| 176 |
|
| 177 |
- **Language Output**: Responds only in Luganda
|
|
@@ -180,15 +167,6 @@ generation_config = {
|
|
| 180 |
- **Context Length**: Limited to 4,096 tokens for optimal performance
|
| 181 |
- **Specialized Domains**: May require domain-specific fine-tuning
|
| 182 |
|
| 183 |
-
## 🤝 Training Details
|
| 184 |
-
|
| 185 |
-
- **Base Model**: Gemma 3 1B Instruction Tuned
|
| 186 |
-
- **Training Method**: GRPO (Generalized Reward Preference Optimization)
|
| 187 |
-
- **Context Length**: 4,096 tokens
|
| 188 |
-
- **Architecture**: Transformer with sliding window attention
|
| 189 |
-
- **Tokenizer**: SentencePiece with 262K vocabulary
|
| 190 |
-
- **Parameters**: 1 billion
|
| 191 |
-
|
| 192 |
## 📄 License
|
| 193 |
|
| 194 |
This model is released under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Please review the terms before use.
|
|
|
|
| 159 |
- **Conversational Practice**: Improve Luganda dialogue skills
|
| 160 |
- **Text Summarization**: Summarize content in Luganda
|
| 161 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
## ⚠️ Limitations
|
| 163 |
|
| 164 |
- **Language Output**: Responds only in Luganda
|
|
|
|
| 167 |
- **Context Length**: Limited to 4,096 tokens for optimal performance
|
| 168 |
- **Specialized Domains**: May require domain-specific fine-tuning
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
## 📄 License
|
| 171 |
|
| 172 |
This model is released under the [Gemma Terms of Use](https://ai.google.dev/gemma/terms). Please review the terms before use.
|