Instructions to use ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16") model = AutoModelForCausalLM.from_pretrained("ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16
- SGLang
How to use ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16 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 "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16 with Docker Model Runner:
docker model run hf.co/ByteDance-Seed/Seed-Coder-8B-Reasoning-bf16
Update tokenizer_config.json
Browse files- tokenizer_config.json +13 -13
tokenizer_config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"0": {
|
| 4 |
-
"content": "<[
|
| 5 |
"lstrip": false,
|
| 6 |
"normalized": false,
|
| 7 |
"rstrip": false,
|
|
@@ -9,7 +9,7 @@
|
|
| 9 |
"special": true
|
| 10 |
},
|
| 11 |
"1": {
|
| 12 |
-
"content": "<[
|
| 13 |
"lstrip": false,
|
| 14 |
"normalized": false,
|
| 15 |
"rstrip": false,
|
|
@@ -17,7 +17,7 @@
|
|
| 17 |
"special": true
|
| 18 |
},
|
| 19 |
"2": {
|
| 20 |
-
"content": "<[
|
| 21 |
"lstrip": false,
|
| 22 |
"normalized": false,
|
| 23 |
"rstrip": false,
|
|
@@ -49,7 +49,7 @@
|
|
| 49 |
"special": true
|
| 50 |
},
|
| 51 |
"6": {
|
| 52 |
-
"content": "<[
|
| 53 |
"lstrip": false,
|
| 54 |
"normalized": false,
|
| 55 |
"rstrip": false,
|
|
@@ -993,7 +993,7 @@
|
|
| 993 |
"special": true
|
| 994 |
},
|
| 995 |
"124": {
|
| 996 |
-
"content": "<[
|
| 997 |
"lstrip": false,
|
| 998 |
"normalized": false,
|
| 999 |
"rstrip": false,
|
|
@@ -1001,7 +1001,7 @@
|
|
| 1001 |
"special": true
|
| 1002 |
},
|
| 1003 |
"125": {
|
| 1004 |
-
"content": "<[
|
| 1005 |
"lstrip": false,
|
| 1006 |
"normalized": false,
|
| 1007 |
"rstrip": false,
|
|
@@ -1009,7 +1009,7 @@
|
|
| 1009 |
"special": true
|
| 1010 |
},
|
| 1011 |
"126": {
|
| 1012 |
-
"content": "<[
|
| 1013 |
"lstrip": false,
|
| 1014 |
"normalized": false,
|
| 1015 |
"rstrip": false,
|
|
@@ -1025,13 +1025,13 @@
|
|
| 1025 |
"special": true
|
| 1026 |
}
|
| 1027 |
},
|
| 1028 |
-
"bos_token": "<[
|
| 1029 |
"chat_template": "{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% set role = message['role'] %}{{ bos_token + role + '\n' + message['content'] | trim + eos_token }}{% endfor %}{% if add_generation_prompt %}{{ bos_token + 'assistant\n'}}{% endif %}",
|
| 1030 |
"clean_up_tokenization_spaces": false,
|
| 1031 |
-
"eos_token": "<[
|
| 1032 |
"extra_special_tokens": {},
|
| 1033 |
"model_max_length": 65536,
|
| 1034 |
-
"pad_token": "<[
|
| 1035 |
-
"sep_token": "<[
|
| 1036 |
-
"tokenizer_class": "
|
| 1037 |
-
}
|
|
|
|
| 1 |
{
|
| 2 |
"added_tokens_decoder": {
|
| 3 |
"0": {
|
| 4 |
+
"content": "<[begin▁of▁sentence]>",
|
| 5 |
"lstrip": false,
|
| 6 |
"normalized": false,
|
| 7 |
"rstrip": false,
|
|
|
|
| 9 |
"special": true
|
| 10 |
},
|
| 11 |
"1": {
|
| 12 |
+
"content": "<[PAD▁TOKEN]>",
|
| 13 |
"lstrip": false,
|
| 14 |
"normalized": false,
|
| 15 |
"rstrip": false,
|
|
|
|
| 17 |
"special": true
|
| 18 |
},
|
| 19 |
"2": {
|
| 20 |
+
"content": "<[end▁of▁sentence]>",
|
| 21 |
"lstrip": false,
|
| 22 |
"normalized": false,
|
| 23 |
"rstrip": false,
|
|
|
|
| 49 |
"special": true
|
| 50 |
},
|
| 51 |
"6": {
|
| 52 |
+
"content": "<[SEP▁TOKEN]>",
|
| 53 |
"lstrip": false,
|
| 54 |
"normalized": false,
|
| 55 |
"rstrip": false,
|
|
|
|
| 993 |
"special": true
|
| 994 |
},
|
| 995 |
"124": {
|
| 996 |
+
"content": "<[fim-prefix]>",
|
| 997 |
"lstrip": false,
|
| 998 |
"normalized": false,
|
| 999 |
"rstrip": false,
|
|
|
|
| 1001 |
"special": true
|
| 1002 |
},
|
| 1003 |
"125": {
|
| 1004 |
+
"content": "<[fim-suffix]>",
|
| 1005 |
"lstrip": false,
|
| 1006 |
"normalized": false,
|
| 1007 |
"rstrip": false,
|
|
|
|
| 1009 |
"special": true
|
| 1010 |
},
|
| 1011 |
"126": {
|
| 1012 |
+
"content": "<[fim-middle]>",
|
| 1013 |
"lstrip": false,
|
| 1014 |
"normalized": false,
|
| 1015 |
"rstrip": false,
|
|
|
|
| 1025 |
"special": true
|
| 1026 |
}
|
| 1027 |
},
|
| 1028 |
+
"bos_token": "<[begin▁of▁sentence]>",
|
| 1029 |
"chat_template": "{% if messages[0]['role'] == 'system' %}{{ raise_exception('System role not supported') }}{% endif %}{% for message in messages %}{% if (message['role'] == 'user') != (loop.index0 % 2 == 0) %}{{ raise_exception('Conversation roles must alternate user/assistant/user/assistant/...') }}{% endif %}{% set role = message['role'] %}{{ bos_token + role + '\n' + message['content'] | trim + eos_token }}{% endfor %}{% if add_generation_prompt %}{{ bos_token + 'assistant\n'}}{% endif %}",
|
| 1030 |
"clean_up_tokenization_spaces": false,
|
| 1031 |
+
"eos_token": "<[end▁of▁sentence]>",
|
| 1032 |
"extra_special_tokens": {},
|
| 1033 |
"model_max_length": 65536,
|
| 1034 |
+
"pad_token": "<[PAD▁TOKEN]>",
|
| 1035 |
+
"sep_token": "<[SEP▁TOKEN]>",
|
| 1036 |
+
"tokenizer_class": "PreTrainedTokenizerFast"
|
| 1037 |
+
}
|