Instructions to use Lugha-Llama/Lugha-Llama-8B-wura_math with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Lugha-Llama/Lugha-Llama-8B-wura_math with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Lugha-Llama/Lugha-Llama-8B-wura_math")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("Lugha-Llama/Lugha-Llama-8B-wura_math") model = AutoModelForMultimodalLM.from_pretrained("Lugha-Llama/Lugha-Llama-8B-wura_math") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Lugha-Llama/Lugha-Llama-8B-wura_math with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Lugha-Llama/Lugha-Llama-8B-wura_math" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lugha-Llama/Lugha-Llama-8B-wura_math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Lugha-Llama/Lugha-Llama-8B-wura_math
- SGLang
How to use Lugha-Llama/Lugha-Llama-8B-wura_math 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 "Lugha-Llama/Lugha-Llama-8B-wura_math" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lugha-Llama/Lugha-Llama-8B-wura_math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Lugha-Llama/Lugha-Llama-8B-wura_math" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Lugha-Llama/Lugha-Llama-8B-wura_math", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Lugha-Llama/Lugha-Llama-8B-wura_math with Docker Model Runner:
docker model run hf.co/Lugha-Llama/Lugha-Llama-8B-wura_math
Lugha-Llama: Adapting Large Language Models for African Languages
Authors: Happy Buzaaba, Alexander Wettig, David Ifeoluwa Adelani, Christiane Fellbaum
Low-resource african languages remain underrepresented in the large training datasets of large language models (LLMs) and, as a result, LLMs struggle to understand these languages. We are releasing three African-centric Lugha-Llama models based on Llama-3.1-8B, which achieve the best performance among open-source models on IrokoBench, a challenging African languages benchmark and AfriQA, a cross-lingual open-retrieval question answering dataset for African languages (Lugha is the Kiswahili word for "language").
All Lugha-Llama models are available on 🤗 huggingface hub.
Read about the findings in this Lugha-Llama blog post.
For the details and findings check the Lugha-Llama paper
- Downloads last month
- 3