Instructions to use blesspearl/math-stackexchange with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use blesspearl/math-stackexchange with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="blesspearl/math-stackexchange")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("blesspearl/math-stackexchange") model = AutoModelForCausalLM.from_pretrained("blesspearl/math-stackexchange", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use blesspearl/math-stackexchange with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "blesspearl/math-stackexchange" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "blesspearl/math-stackexchange", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/blesspearl/math-stackexchange
- SGLang
How to use blesspearl/math-stackexchange 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 "blesspearl/math-stackexchange" \ --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": "blesspearl/math-stackexchange", "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 "blesspearl/math-stackexchange" \ --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": "blesspearl/math-stackexchange", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use blesspearl/math-stackexchange with Docker Model Runner:
docker model run hf.co/blesspearl/math-stackexchange
Upload tokenizer
Browse files- special_tokens_map.json +2 -1
- tokenizer.json +9 -0
- tokenizer_config.json +9 -0
special_tokens_map.json
CHANGED
|
@@ -12,5 +12,6 @@
|
|
| 12 |
"normalized": false,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
-
}
|
|
|
|
| 16 |
}
|
|
|
|
| 12 |
"normalized": false,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
+
},
|
| 16 |
+
"pad_token": "<|end_of_text|>"
|
| 17 |
}
|
tokenizer.json
CHANGED
|
@@ -2306,6 +2306,15 @@
|
|
| 2306 |
"rstrip": false,
|
| 2307 |
"normalized": false,
|
| 2308 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2309 |
}
|
| 2310 |
],
|
| 2311 |
"normalizer": null,
|
|
|
|
| 2306 |
"rstrip": false,
|
| 2307 |
"normalized": false,
|
| 2308 |
"special": true
|
| 2309 |
+
},
|
| 2310 |
+
{
|
| 2311 |
+
"id": 128256,
|
| 2312 |
+
"content": "[PAD]",
|
| 2313 |
+
"single_word": false,
|
| 2314 |
+
"lstrip": false,
|
| 2315 |
+
"rstrip": false,
|
| 2316 |
+
"normalized": false,
|
| 2317 |
+
"special": true
|
| 2318 |
}
|
| 2319 |
],
|
| 2320 |
"normalizer": null,
|
tokenizer_config.json
CHANGED
|
@@ -2047,6 +2047,14 @@
|
|
| 2047 |
"rstrip": false,
|
| 2048 |
"single_word": false,
|
| 2049 |
"special": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2050 |
}
|
| 2051 |
},
|
| 2052 |
"bos_token": "<|begin_of_text|>",
|
|
@@ -2057,5 +2065,6 @@
|
|
| 2057 |
"attention_mask"
|
| 2058 |
],
|
| 2059 |
"model_max_length": 131072,
|
|
|
|
| 2060 |
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 2061 |
}
|
|
|
|
| 2047 |
"rstrip": false,
|
| 2048 |
"single_word": false,
|
| 2049 |
"special": true
|
| 2050 |
+
},
|
| 2051 |
+
"128256": {
|
| 2052 |
+
"content": "[PAD]",
|
| 2053 |
+
"lstrip": false,
|
| 2054 |
+
"normalized": false,
|
| 2055 |
+
"rstrip": false,
|
| 2056 |
+
"single_word": false,
|
| 2057 |
+
"special": true
|
| 2058 |
}
|
| 2059 |
},
|
| 2060 |
"bos_token": "<|begin_of_text|>",
|
|
|
|
| 2065 |
"attention_mask"
|
| 2066 |
],
|
| 2067 |
"model_max_length": 131072,
|
| 2068 |
+
"pad_token": "<|end_of_text|>",
|
| 2069 |
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 2070 |
}
|