Instructions to use Chakita/MathBloom-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Chakita/MathBloom-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Chakita/MathBloom-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Chakita/MathBloom-2") model = AutoModelForCausalLM.from_pretrained("Chakita/MathBloom-2", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Chakita/MathBloom-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Chakita/MathBloom-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Chakita/MathBloom-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Chakita/MathBloom-2
- SGLang
How to use Chakita/MathBloom-2 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 "Chakita/MathBloom-2" \ --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": "Chakita/MathBloom-2", "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 "Chakita/MathBloom-2" \ --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": "Chakita/MathBloom-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Chakita/MathBloom-2 with Docker Model Runner:
docker model run hf.co/Chakita/MathBloom-2
add tokenizer
Browse files- special_tokens_map.json +13 -0
- tokenizer.json +2 -2
- tokenizer_config.json +14 -0
special_tokens_map.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"bos_token": "<s>",
|
| 3 |
"eos_token": "</s>",
|
| 4 |
"pad_token": "<pad>",
|
|
|
|
| 1 |
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<BRG>",
|
| 4 |
+
"N_00",
|
| 5 |
+
"N_01",
|
| 6 |
+
"N_02",
|
| 7 |
+
"N_03",
|
| 8 |
+
"N_04",
|
| 9 |
+
"N_05",
|
| 10 |
+
"N_06",
|
| 11 |
+
"N_07",
|
| 12 |
+
"N_08",
|
| 13 |
+
"N_09"
|
| 14 |
+
],
|
| 15 |
"bos_token": "<s>",
|
| 16 |
"eos_token": "</s>",
|
| 17 |
"pad_token": "<pad>",
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aa8a458a0b4246af98eeba2630a5817264d60de06571c35bcc5b9927de0d968f
|
| 3 |
+
size 14502533
|
tokenizer_config.json
CHANGED
|
@@ -1,5 +1,19 @@
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
"bos_token": "<s>",
|
| 4 |
"eos_token": "</s>",
|
| 5 |
"name_or_path": "bigscience/bloom-560m",
|
|
|
|
| 1 |
{
|
| 2 |
"add_prefix_space": false,
|
| 3 |
+
"add_special_tokens": true,
|
| 4 |
+
"additional_special_tokens": [
|
| 5 |
+
"<BRG>",
|
| 6 |
+
"N_00",
|
| 7 |
+
"N_01",
|
| 8 |
+
"N_02",
|
| 9 |
+
"N_03",
|
| 10 |
+
"N_04",
|
| 11 |
+
"N_05",
|
| 12 |
+
"N_06",
|
| 13 |
+
"N_07",
|
| 14 |
+
"N_08",
|
| 15 |
+
"N_09"
|
| 16 |
+
],
|
| 17 |
"bos_token": "<s>",
|
| 18 |
"eos_token": "</s>",
|
| 19 |
"name_or_path": "bigscience/bloom-560m",
|