Instructions to use fxmarty/tiny-llama-fast-tokenizer with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fxmarty/tiny-llama-fast-tokenizer with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="fxmarty/tiny-llama-fast-tokenizer")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("fxmarty/tiny-llama-fast-tokenizer") model = AutoModelForCausalLM.from_pretrained("fxmarty/tiny-llama-fast-tokenizer") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fxmarty/tiny-llama-fast-tokenizer with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fxmarty/tiny-llama-fast-tokenizer" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fxmarty/tiny-llama-fast-tokenizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fxmarty/tiny-llama-fast-tokenizer
- SGLang
How to use fxmarty/tiny-llama-fast-tokenizer 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 "fxmarty/tiny-llama-fast-tokenizer" \ --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": "fxmarty/tiny-llama-fast-tokenizer", "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 "fxmarty/tiny-llama-fast-tokenizer" \ --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": "fxmarty/tiny-llama-fast-tokenizer", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fxmarty/tiny-llama-fast-tokenizer with Docker Model Runner:
docker model run hf.co/fxmarty/tiny-llama-fast-tokenizer
Félix Marty commited on
Commit ·
c11267e
1
Parent(s): daae59b
fix tokenizer?
Browse files- special_tokens_map.json +3 -3
- tokenizer.json +7 -1
- tokenizer_config.json +4 -6
special_tokens_map.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
| 1 |
{
|
| 2 |
"bos_token": {
|
| 3 |
-
"content": "",
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": true,
|
| 6 |
"rstrip": false,
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
-
"content": "",
|
| 11 |
"lstrip": false,
|
| 12 |
"normalized": true,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"unk_token": {
|
| 17 |
-
"content": "",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": true,
|
| 20 |
"rstrip": false,
|
|
|
|
| 1 |
{
|
| 2 |
"bos_token": {
|
| 3 |
+
"content": "<s>",
|
| 4 |
"lstrip": false,
|
| 5 |
"normalized": true,
|
| 6 |
"rstrip": false,
|
| 7 |
"single_word": false
|
| 8 |
},
|
| 9 |
"eos_token": {
|
| 10 |
+
"content": "</s>",
|
| 11 |
"lstrip": false,
|
| 12 |
"normalized": true,
|
| 13 |
"rstrip": false,
|
| 14 |
"single_word": false
|
| 15 |
},
|
| 16 |
"unk_token": {
|
| 17 |
+
"content": "<unk>",
|
| 18 |
"lstrip": false,
|
| 19 |
"normalized": true,
|
| 20 |
"rstrip": false,
|
tokenizer.json
CHANGED
|
@@ -77,10 +77,16 @@
|
|
| 77 |
"type_id": 0
|
| 78 |
}
|
| 79 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
{
|
| 81 |
"Sequence": {
|
| 82 |
"id": "B",
|
| 83 |
-
"type_id":
|
| 84 |
}
|
| 85 |
}
|
| 86 |
],
|
|
|
|
| 77 |
"type_id": 0
|
| 78 |
}
|
| 79 |
},
|
| 80 |
+
{
|
| 81 |
+
"SpecialToken": {
|
| 82 |
+
"id": "<s>",
|
| 83 |
+
"type_id": 1
|
| 84 |
+
}
|
| 85 |
+
},
|
| 86 |
{
|
| 87 |
"Sequence": {
|
| 88 |
"id": "B",
|
| 89 |
+
"type_id": 1
|
| 90 |
}
|
| 91 |
}
|
| 92 |
],
|
tokenizer_config.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
-
"add_eos_token": false,
|
| 4 |
"bos_token": {
|
| 5 |
"__type": "AddedToken",
|
| 6 |
-
"content": "",
|
| 7 |
"lstrip": false,
|
| 8 |
"normalized": true,
|
| 9 |
"rstrip": false,
|
|
@@ -12,19 +10,19 @@
|
|
| 12 |
"clean_up_tokenization_spaces": false,
|
| 13 |
"eos_token": {
|
| 14 |
"__type": "AddedToken",
|
| 15 |
-
"content": "",
|
| 16 |
"lstrip": false,
|
| 17 |
"normalized": true,
|
| 18 |
"rstrip": false,
|
| 19 |
"single_word": false
|
| 20 |
},
|
| 21 |
-
"model_max_length":
|
| 22 |
"pad_token": null,
|
| 23 |
"sp_model_kwargs": {},
|
| 24 |
"tokenizer_class": "LlamaTokenizer",
|
| 25 |
"unk_token": {
|
| 26 |
"__type": "AddedToken",
|
| 27 |
-
"content": "",
|
| 28 |
"lstrip": false,
|
| 29 |
"normalized": true,
|
| 30 |
"rstrip": false,
|
|
|
|
| 1 |
{
|
|
|
|
|
|
|
| 2 |
"bos_token": {
|
| 3 |
"__type": "AddedToken",
|
| 4 |
+
"content": "<s>",
|
| 5 |
"lstrip": false,
|
| 6 |
"normalized": true,
|
| 7 |
"rstrip": false,
|
|
|
|
| 10 |
"clean_up_tokenization_spaces": false,
|
| 11 |
"eos_token": {
|
| 12 |
"__type": "AddedToken",
|
| 13 |
+
"content": "</s>",
|
| 14 |
"lstrip": false,
|
| 15 |
"normalized": true,
|
| 16 |
"rstrip": false,
|
| 17 |
"single_word": false
|
| 18 |
},
|
| 19 |
+
"model_max_length": 2048,
|
| 20 |
"pad_token": null,
|
| 21 |
"sp_model_kwargs": {},
|
| 22 |
"tokenizer_class": "LlamaTokenizer",
|
| 23 |
"unk_token": {
|
| 24 |
"__type": "AddedToken",
|
| 25 |
+
"content": "<unk>",
|
| 26 |
"lstrip": false,
|
| 27 |
"normalized": true,
|
| 28 |
"rstrip": false,
|