Instructions to use MBZUAI/MobiLlama-05B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MBZUAI/MobiLlama-05B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MBZUAI/MobiLlama-05B", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MBZUAI/MobiLlama-05B", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use MBZUAI/MobiLlama-05B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MBZUAI/MobiLlama-05B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MBZUAI/MobiLlama-05B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/MBZUAI/MobiLlama-05B
- SGLang
How to use MBZUAI/MobiLlama-05B 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 "MBZUAI/MobiLlama-05B" \ --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": "MBZUAI/MobiLlama-05B", "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 "MBZUAI/MobiLlama-05B" \ --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": "MBZUAI/MobiLlama-05B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use MBZUAI/MobiLlama-05B with Docker Model Runner:
docker model run hf.co/MBZUAI/MobiLlama-05B
Update README.md
#1
by Ashmal - opened
README.md
CHANGED
|
@@ -2,11 +2,13 @@
|
|
| 2 |
license: mit
|
| 3 |
license_link: https://huggingface.co/microsoft/phi-2/resolve/main/LICENSE
|
| 4 |
language:
|
| 5 |
-
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
| 10 |
---
|
| 11 |
# MobiLlama-05B
|
| 12 |
|
|
@@ -57,7 +59,20 @@ print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())
|
|
| 57 |
|
| 58 |
```
|
| 59 |
|
| 60 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
-
|
| 63 |
|
|
|
|
|
|
| 2 |
license: mit
|
| 3 |
license_link: https://huggingface.co/microsoft/phi-2/resolve/main/LICENSE
|
| 4 |
language:
|
| 5 |
+
- en
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
+
- nlp
|
| 9 |
+
- code
|
| 10 |
+
datasets:
|
| 11 |
+
- LLM360/AmberDatasets
|
| 12 |
---
|
| 13 |
# MobiLlama-05B
|
| 14 |
|
|
|
|
| 59 |
|
| 60 |
```
|
| 61 |
|
| 62 |
+
## Evaluation
|
| 63 |
+
| Evaluation Benchmark | MobiLlama-0.5B | MobiLlama-0.8B | MobiLlama-1.2B |
|
| 64 |
+
| ----------- | ----------- | ----------- |
|
| 65 |
+
| HellaSwag | 0.5252 | 0.5409 | 0.6299 |
|
| 66 |
+
| MMLU | 0.2645 | 0.2692 | 0.2423 |
|
| 67 |
+
| Arc Challenge | 0.2952 | 0.3020 | 0.3455 |
|
| 68 |
+
| TruthfulQA | 0.3805 | 0.3848 | 0.3557 |
|
| 69 |
+
| CrowsPairs | 0.6403 | 0.6482 | 0.6812 |
|
| 70 |
+
| PIQA | 0.7203 | 0.7317 | 0.7529 |
|
| 71 |
+
| Race | 0.3368 | 0.3337 | 0.3531 |
|
| 72 |
+
| SIQA | 0.4022 | 0.4160 | 0.4196 |
|
| 73 |
+
| Winogrande | 0.5753 | 0.5745 | 0.6108 |
|
| 74 |
+
|
| 75 |
|
| 76 |
+
## Intended Uses
|
| 77 |
|
| 78 |
+
Given the nature of the training data, the MobiLlama-05B model is best suited for prompts using the QA format, the chat format, and the code format.
|