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