Text Generation
Transformers
Safetensors
ouro
looped-language-model
reasoning
recurrent-depth
conversational
custom_code
Instructions to use ByteDance/Ouro-2.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance/Ouro-2.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ByteDance/Ouro-2.6B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ByteDance/Ouro-2.6B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ByteDance/Ouro-2.6B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ByteDance/Ouro-2.6B" # 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/Ouro-2.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ByteDance/Ouro-2.6B
- SGLang
How to use ByteDance/Ouro-2.6B 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/Ouro-2.6B" \ --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/Ouro-2.6B", "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/Ouro-2.6B" \ --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/Ouro-2.6B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ByteDance/Ouro-2.6B with Docker Model Runner:
docker model run hf.co/ByteDance/Ouro-2.6B
Fix bos/eos token IDs (config.json + tokenizer_config.json)
#5
by KristianS7 - opened
- config.json +2 -2
- tokenizer_config.json +2 -2
config.json
CHANGED
|
@@ -8,8 +8,8 @@
|
|
| 8 |
"AutoModel": "modeling_ouro.OuroModel",
|
| 9 |
"AutoModelForCausalLM": "modeling_ouro.OuroForCausalLM"
|
| 10 |
},
|
| 11 |
-
"bos_token_id":
|
| 12 |
-
"eos_token_id":
|
| 13 |
"head_dim": 128,
|
| 14 |
"hidden_act": "silu",
|
| 15 |
"hidden_size": 2048,
|
|
|
|
| 8 |
"AutoModel": "modeling_ouro.OuroModel",
|
| 9 |
"AutoModelForCausalLM": "modeling_ouro.OuroForCausalLM"
|
| 10 |
},
|
| 11 |
+
"bos_token_id": 1,
|
| 12 |
+
"eos_token_id": 2,
|
| 13 |
"head_dim": 128,
|
| 14 |
"hidden_act": "silu",
|
| 15 |
"hidden_size": 2048,
|
tokenizer_config.json
CHANGED
|
@@ -157,10 +157,10 @@
|
|
| 157 |
"<jupyter_script>",
|
| 158 |
"<empty_output>"
|
| 159 |
],
|
| 160 |
-
"bos_token": "<|
|
| 161 |
"clean_up_tokenization_spaces": false,
|
| 162 |
"chat_template": "{%- if messages[0]['role'] == 'system' -%}{{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}{%- else -%}{{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}{%- endif -%}{%- for message in messages -%}{%- if message.role == 'system' and loop.first -%}{# Skip #}{%- else -%}{{- '<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|im_start|>assistant\\n' }}{%- endif -%}",
|
| 163 |
-
"eos_token": "<|
|
| 164 |
"extra_special_tokens": {},
|
| 165 |
"model_max_length": 131072,
|
| 166 |
"tokenizer_class": "GPT2Tokenizer",
|
|
|
|
| 157 |
"<jupyter_script>",
|
| 158 |
"<empty_output>"
|
| 159 |
],
|
| 160 |
+
"bos_token": "<|im_start|>",
|
| 161 |
"clean_up_tokenization_spaces": false,
|
| 162 |
"chat_template": "{%- if messages[0]['role'] == 'system' -%}{{- '<|im_start|>system\\n' + messages[0]['content'] + '<|im_end|>\\n' }}{%- else -%}{{- '<|im_start|>system\\nYou are a helpful assistant.<|im_end|>\\n' }}{%- endif -%}{%- for message in messages -%}{%- if message.role == 'system' and loop.first -%}{# Skip #}{%- else -%}{{- '<|im_start|>' + message['role'] + '\\n' + message['content'] + '<|im_end|>' + '\\n' }}{%- endif -%}{%- endfor -%}{%- if add_generation_prompt -%}{{- '<|im_start|>assistant\\n' }}{%- endif -%}",
|
| 163 |
+
"eos_token": "<|im_end|>",
|
| 164 |
"extra_special_tokens": {},
|
| 165 |
"model_max_length": 131072,
|
| 166 |
"tokenizer_class": "GPT2Tokenizer",
|