Instructions to use typeof/tiny-llama-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use typeof/tiny-llama-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="typeof/tiny-llama-1B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("typeof/tiny-llama-1B") model = AutoModelForCausalLM.from_pretrained("typeof/tiny-llama-1B") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use typeof/tiny-llama-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "typeof/tiny-llama-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "typeof/tiny-llama-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/typeof/tiny-llama-1B
- SGLang
How to use typeof/tiny-llama-1B 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 "typeof/tiny-llama-1B" \ --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": "typeof/tiny-llama-1B", "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 "typeof/tiny-llama-1B" \ --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": "typeof/tiny-llama-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use typeof/tiny-llama-1B with Docker Model Runner:
docker model run hf.co/typeof/tiny-llama-1B
typeof commited on
Commit ·
20f6130
1
Parent(s): bf16fde
updating tokenizer_config.json
Browse files- tokenizer_config.json +29 -25
tokenizer_config.json
CHANGED
|
@@ -1,35 +1,39 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
},
|
|
|
|
| 12 |
"clean_up_tokenization_spaces": false,
|
| 13 |
-
"eos_token":
|
| 14 |
-
"__type": "AddedToken",
|
| 15 |
-
"content": "</s>",
|
| 16 |
-
"lstrip": false,
|
| 17 |
-
"normalized": false,
|
| 18 |
-
"rstrip": false,
|
| 19 |
-
"single_word": false
|
| 20 |
-
},
|
| 21 |
"legacy": false,
|
| 22 |
"model_max_length": 1000000000000000019884624838656,
|
| 23 |
"pad_token": null,
|
| 24 |
"padding_side": "right",
|
| 25 |
"sp_model_kwargs": {},
|
| 26 |
"tokenizer_class": "LlamaTokenizer",
|
| 27 |
-
"unk_token":
|
| 28 |
-
|
| 29 |
-
"content": "<unk>",
|
| 30 |
-
"lstrip": false,
|
| 31 |
-
"normalized": false,
|
| 32 |
-
"rstrip": false,
|
| 33 |
-
"single_word": false
|
| 34 |
-
}
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<unk>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<s>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
}
|
| 27 |
},
|
| 28 |
+
"bos_token": "<s>",
|
| 29 |
"clean_up_tokenization_spaces": false,
|
| 30 |
+
"eos_token": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
"legacy": false,
|
| 32 |
"model_max_length": 1000000000000000019884624838656,
|
| 33 |
"pad_token": null,
|
| 34 |
"padding_side": "right",
|
| 35 |
"sp_model_kwargs": {},
|
| 36 |
"tokenizer_class": "LlamaTokenizer",
|
| 37 |
+
"unk_token": "<unk>",
|
| 38 |
+
"use_default_system_prompt": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
}
|