Text Generation
Transformers
Safetensors
English
Korean
Japanese
solar_open2
upstage
solar
Mixture of Experts
llm
vllm
conversational
Eval Results
Instructions to use upstage/Solar-Open2-250B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use upstage/Solar-Open2-250B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="upstage/Solar-Open2-250B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("upstage/Solar-Open2-250B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use upstage/Solar-Open2-250B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "upstage/Solar-Open2-250B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "upstage/Solar-Open2-250B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/upstage/Solar-Open2-250B
- SGLang
How to use upstage/Solar-Open2-250B 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 "upstage/Solar-Open2-250B" \ --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": "upstage/Solar-Open2-250B", "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 "upstage/Solar-Open2-250B" \ --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": "upstage/Solar-Open2-250B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use upstage/Solar-Open2-250B with Docker Model Runner:
docker model run hf.co/upstage/Solar-Open2-250B
Chat template: bound the tool block scan
#10
by vMaroon - opened
- chat_template.jinja +19 -9
chat_template.jinja
CHANGED
|
@@ -116,6 +116,21 @@ Input convention for `tool_arguments`:
|
|
| 116 |
{{- "<|im:end|>\n" }}
|
| 117 |
{%- endif -%}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
{#- ======== Render main messages ======== #}
|
| 120 |
{%- for message in messages -%}
|
| 121 |
{%- if message.role == 'user' -%}
|
|
@@ -130,16 +145,11 @@ Input convention for `tool_arguments`:
|
|
| 130 |
{%- if not prev_is_tool -%}
|
| 131 |
{%- set start_idx = loop.index0 -%}
|
| 132 |
{#- Collect contiguous tool messages starting at start_idx -#}
|
| 133 |
-
{%- set tool_ns = namespace(items=[]
|
| 134 |
-
{%- for j in range(start_idx,
|
| 135 |
-
{%-
|
| 136 |
-
{%- if messages[j].role == 'tool' -%}
|
| 137 |
-
{%- set tool_ns.items = tool_ns.items + [messages[j]] -%}
|
| 138 |
-
{%- else -%}
|
| 139 |
-
{%- set tool_ns.scanning = false -%}
|
| 140 |
-
{%- endif -%}
|
| 141 |
-
{%- endif -%}
|
| 142 |
{%- endfor -%}
|
|
|
|
| 143 |
|
| 144 |
{{- "<|im:start|>tool<|im:content|>" }}
|
| 145 |
|
|
|
|
| 116 |
{{- "<|im:end|>\n" }}
|
| 117 |
{%- endif -%}
|
| 118 |
|
| 119 |
+
{#- tool_block_len: the length of each contiguous block of tool messages, in order. -#}
|
| 120 |
+
{%- set block_ns = namespace(len=0, lens=[], i=0) -%}
|
| 121 |
+
{%- for m in messages -%}
|
| 122 |
+
{%- if m.role == 'tool' -%}
|
| 123 |
+
{%- set block_ns.len = block_ns.len + 1 -%}
|
| 124 |
+
{%- elif block_ns.len -%}
|
| 125 |
+
{%- set block_ns.lens = block_ns.lens + [block_ns.len] -%}
|
| 126 |
+
{%- set block_ns.len = 0 -%}
|
| 127 |
+
{%- endif -%}
|
| 128 |
+
{%- endfor -%}
|
| 129 |
+
{%- if block_ns.len -%}
|
| 130 |
+
{%- set block_ns.lens = block_ns.lens + [block_ns.len] -%}
|
| 131 |
+
{%- endif -%}
|
| 132 |
+
{%- set tool_block_len = block_ns.lens -%}
|
| 133 |
+
|
| 134 |
{#- ======== Render main messages ======== #}
|
| 135 |
{%- for message in messages -%}
|
| 136 |
{%- if message.role == 'user' -%}
|
|
|
|
| 145 |
{%- if not prev_is_tool -%}
|
| 146 |
{%- set start_idx = loop.index0 -%}
|
| 147 |
{#- Collect contiguous tool messages starting at start_idx -#}
|
| 148 |
+
{%- set tool_ns = namespace(items=[]) -%}
|
| 149 |
+
{%- for j in range(start_idx, start_idx + tool_block_len[block_ns.i]) -%}
|
| 150 |
+
{%- set tool_ns.items = tool_ns.items + [messages[j]] -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
{%- endfor -%}
|
| 152 |
+
{%- set block_ns.i = block_ns.i + 1 -%}
|
| 153 |
|
| 154 |
{{- "<|im:start|>tool<|im:content|>" }}
|
| 155 |
|