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