Text Generation
Transformers
Safetensors
qwen3_5_moe
image-text-to-text
text-generation-inference
unsloth
qwen3_6
Mixture of Experts
coder
agent
tool-use
function-calling
thinking-off
long-context
lora
sft
logic
conversational
Instructions to use Jackrong/Qwopus3.6-35B-A3B-Coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Jackrong/Qwopus3.6-35B-A3B-Coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Jackrong/Qwopus3.6-35B-A3B-Coder") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Jackrong/Qwopus3.6-35B-A3B-Coder") model = AutoModelForMultimodalLM.from_pretrained("Jackrong/Qwopus3.6-35B-A3B-Coder") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Jackrong/Qwopus3.6-35B-A3B-Coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Jackrong/Qwopus3.6-35B-A3B-Coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Jackrong/Qwopus3.6-35B-A3B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Jackrong/Qwopus3.6-35B-A3B-Coder
- SGLang
How to use Jackrong/Qwopus3.6-35B-A3B-Coder 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 "Jackrong/Qwopus3.6-35B-A3B-Coder" \ --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": "Jackrong/Qwopus3.6-35B-A3B-Coder", "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 "Jackrong/Qwopus3.6-35B-A3B-Coder" \ --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": "Jackrong/Qwopus3.6-35B-A3B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use Jackrong/Qwopus3.6-35B-A3B-Coder with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Jackrong/Qwopus3.6-35B-A3B-Coder to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Jackrong/Qwopus3.6-35B-A3B-Coder to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Jackrong/Qwopus3.6-35B-A3B-Coder to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="Jackrong/Qwopus3.6-35B-A3B-Coder", max_seq_length=2048, ) - Docker Model Runner
How to use Jackrong/Qwopus3.6-35B-A3B-Coder with Docker Model Runner:
docker model run hf.co/Jackrong/Qwopus3.6-35B-A3B-Coder
Update 35B Coder chat template
Browse files- chat_template.jinja +16 -13
- tokenizer_config.json +2 -2
chat_template.jinja
CHANGED
|
@@ -39,9 +39,7 @@
|
|
| 39 |
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
{%- endif %}
|
| 41 |
{%- endmacro %}
|
| 42 |
-
{%- if
|
| 43 |
-
{{- raise_exception('No messages provided.') }}
|
| 44 |
-
{%- endif %}
|
| 45 |
{%- if tools and tools is iterable and tools is not mapping %}
|
| 46 |
{{- '<|im_start|>system\n' }}
|
| 47 |
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
|
@@ -75,9 +73,6 @@
|
|
| 75 |
{%- endif %}
|
| 76 |
{%- endif %}
|
| 77 |
{%- endfor %}
|
| 78 |
-
{%- if ns.multi_step_tool %}
|
| 79 |
-
{{- raise_exception('No user query found in messages.') }}
|
| 80 |
-
{%- endif %}
|
| 81 |
{%- for message in messages %}
|
| 82 |
{%- set content = render_content(message.content, true)|trim %}
|
| 83 |
{%- if message.role == "system" %}
|
|
@@ -109,22 +104,29 @@
|
|
| 109 |
{%- endif %}
|
| 110 |
{%- if loop.first %}
|
| 111 |
{%- if content|trim %}
|
| 112 |
-
{{- '\n\n
|
| 113 |
-
{%- else %}
|
| 114 |
-
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 115 |
{%- endif %}
|
| 116 |
{%- else %}
|
| 117 |
-
{{- '\n
|
| 118 |
{%- endif %}
|
| 119 |
-
{%- if tool_call.arguments is
|
|
|
|
| 120 |
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 121 |
{{- '<parameter=' + args_name + '>\n' }}
|
| 122 |
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 123 |
{{- args_value }}
|
| 124 |
{{- '\n</parameter>\n' }}
|
| 125 |
{%- endfor %}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
{%- endif %}
|
| 127 |
-
{{- '</function>\n</tool_call>' }}
|
| 128 |
{%- endfor %}
|
| 129 |
{%- endif %}
|
| 130 |
{{- '<|im_end|>\n' }}
|
|
@@ -151,4 +153,5 @@
|
|
| 151 |
{%- else %}
|
| 152 |
{{- '<think>\n' }}
|
| 153 |
{%- endif %}
|
| 154 |
-
{%- endif %}
|
|
|
|
|
|
| 39 |
{{- raise_exception('Unexpected content type.') }}
|
| 40 |
{%- endif %}
|
| 41 |
{%- endmacro %}
|
| 42 |
+
{%- if messages %}
|
|
|
|
|
|
|
| 43 |
{%- if tools and tools is iterable and tools is not mapping %}
|
| 44 |
{{- '<|im_start|>system\n' }}
|
| 45 |
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
|
|
|
| 73 |
{%- endif %}
|
| 74 |
{%- endif %}
|
| 75 |
{%- endfor %}
|
|
|
|
|
|
|
|
|
|
| 76 |
{%- for message in messages %}
|
| 77 |
{%- set content = render_content(message.content, true)|trim %}
|
| 78 |
{%- if message.role == "system" %}
|
|
|
|
| 104 |
{%- endif %}
|
| 105 |
{%- if loop.first %}
|
| 106 |
{%- if content|trim %}
|
| 107 |
+
{{- '\n\n' }}
|
|
|
|
|
|
|
| 108 |
{%- endif %}
|
| 109 |
{%- else %}
|
| 110 |
+
{{- '\n' }}
|
| 111 |
{%- endif %}
|
| 112 |
+
{%- if tool_call.arguments is mapping %}
|
| 113 |
+
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 114 |
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 115 |
{{- '<parameter=' + args_name + '>\n' }}
|
| 116 |
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 117 |
{{- args_value }}
|
| 118 |
{{- '\n</parameter>\n' }}
|
| 119 |
{%- endfor %}
|
| 120 |
+
{{- '</function>\n</tool_call>' }}
|
| 121 |
+
{%- else %}
|
| 122 |
+
{{- '<tool_call>\n{"name": ' + tool_call.name|tojson + ', "arguments": ' }}
|
| 123 |
+
{%- if tool_call.arguments is string %}
|
| 124 |
+
{{- tool_call.arguments }}
|
| 125 |
+
{%- else %}
|
| 126 |
+
{{- tool_call.arguments | tojson | safe }}
|
| 127 |
+
{%- endif %}
|
| 128 |
+
{{- '}\n</tool_call>' }}
|
| 129 |
{%- endif %}
|
|
|
|
| 130 |
{%- endfor %}
|
| 131 |
{%- endif %}
|
| 132 |
{{- '<|im_end|>\n' }}
|
|
|
|
| 153 |
{%- else %}
|
| 154 |
{{- '<think>\n' }}
|
| 155 |
{%- endif %}
|
| 156 |
+
{%- endif %}
|
| 157 |
+
{%- endif %}
|
tokenizer_config.json
CHANGED
|
@@ -296,5 +296,5 @@
|
|
| 296 |
"special": true
|
| 297 |
}
|
| 298 |
},
|
| 299 |
-
"chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if
|
| 300 |
-
}
|
|
|
|
| 296 |
"special": true
|
| 297 |
}
|
| 298 |
},
|
| 299 |
+
"chat_template": "{%- set image_count = namespace(value=0) %}\n{%- set video_count = namespace(value=0) %}\n{%- macro render_content(content, do_vision_count, is_system_content=false) %}\n {%- if content is string %}\n {{- content }}\n {%- elif content is iterable and content is not mapping %}\n {%- for item in content %}\n {%- if 'image' in item or 'image_url' in item or item.type == 'image' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain images.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set image_count.value = image_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Picture ' ~ image_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|image_pad|><|vision_end|>' }}\n {%- elif 'video' in item or item.type == 'video' %}\n {%- if is_system_content %}\n {{- raise_exception('System message cannot contain videos.') }}\n {%- endif %}\n {%- if do_vision_count %}\n {%- set video_count.value = video_count.value + 1 %}\n {%- endif %}\n {%- if add_vision_id %}\n {{- 'Video ' ~ video_count.value ~ ': ' }}\n {%- endif %}\n {{- '<|vision_start|><|video_pad|><|vision_end|>' }}\n {%- elif 'text' in item %}\n {{- item.text }}\n {%- else %}\n {{- raise_exception('Unexpected item type in content.') }}\n {%- endif %}\n {%- endfor %}\n {%- elif content is none or content is undefined %}\n {{- '' }}\n {%- else %}\n {{- raise_exception('Unexpected content type.') }}\n {%- endif %}\n{%- endmacro %}\n{%- if messages %}\n{%- if tools and tools is iterable and tools is not mapping %}\n {{- '<|im_start|>system\\n' }}\n {{- \"# Tools\\n\\nYou have access to the following functions:\\n\\n<tools>\" }}\n {%- for tool in tools %}\n {{- \"\\n\" }}\n {{- tool | tojson }}\n {%- endfor %}\n {{- \"\\n</tools>\" }}\n {{- '\\n\\nIf you choose to call a function ONLY reply in the following format with NO suffix:\\n\\n<tool_call>\\n<function=example_function_name>\\n<parameter=example_parameter_1>\\nvalue_1\\n</parameter>\\n<parameter=example_parameter_2>\\nThis is the value for the second parameter\\nthat can span\\nmultiple lines\\n</parameter>\\n</function>\\n</tool_call>\\n\\n<IMPORTANT>\\nReminder:\\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\\n- Required parameters MUST be specified\\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\\n</IMPORTANT>' }}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {%- if content %}\n {{- '\\n\\n' + content }}\n {%- endif %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n{%- else %}\n {%- if messages[0].role == 'system' %}\n {%- set content = render_content(messages[0].content, false, true)|trim %}\n {{- '<|im_start|>system\\n' + content + '<|im_end|>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}\n{%- for message in messages[::-1] %}\n {%- set index = (messages|length - 1) - loop.index0 %}\n {%- if ns.multi_step_tool and message.role == \"user\" %}\n {%- set content = render_content(message.content, false)|trim %}\n {%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}\n {%- set ns.multi_step_tool = false %}\n {%- set ns.last_query_index = index %}\n {%- endif %}\n {%- endif %}\n{%- endfor %}\n{%- for message in messages %}\n {%- set content = render_content(message.content, true)|trim %}\n {%- if message.role == \"system\" %}\n {%- if not loop.first %}\n {{- raise_exception('System message must be at the beginning.') }}\n {%- endif %}\n {%- elif message.role == \"user\" %}\n {{- '<|im_start|>' + message.role + '\\n' + content + '<|im_end|>' + '\\n' }}\n {%- elif message.role == \"assistant\" %}\n {%- set reasoning_content = '' %}\n {%- if message.reasoning_content is string %}\n {%- set reasoning_content = message.reasoning_content %}\n {%- else %}\n {%- if '</think>' in content %}\n {%- set reasoning_content = content.split('</think>')[0].rstrip('\\n').split('<think>')[-1].lstrip('\\n') %}\n {%- set content = content.split('</think>')[-1].lstrip('\\n') %}\n {%- endif %}\n {%- endif %}\n {%- set reasoning_content = reasoning_content|trim %}\n {%- if (preserve_thinking is defined and preserve_thinking is true) or (loop.index0 > ns.last_query_index) %}\n {{- '<|im_start|>' + message.role + '\\n<think>\\n' + reasoning_content + '\\n</think>\\n\\n' + content }}\n {%- else %}\n {{- '<|im_start|>' + message.role + '\\n' + content }}\n {%- endif %}\n {%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}\n {%- for tool_call in message.tool_calls %}\n {%- if tool_call.function is defined %}\n {%- set tool_call = tool_call.function %}\n {%- endif %}\n {%- if loop.first %}\n {%- if content|trim %}\n {{- '\\n\\n' }}\n {%- endif %}\n {%- else %}\n {{- '\\n' }}\n {%- endif %}\n {%- if tool_call.arguments is mapping %}\n {{- '<tool_call>\\n<function=' + tool_call.name + '>\\n' }}\n {%- for args_name, args_value in tool_call.arguments|items %}\n {{- '<parameter=' + args_name + '>\\n' }}\n {%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}\n {{- args_value }}\n {{- '\\n</parameter>\\n' }}\n {%- endfor %}\n {{- '</function>\\n</tool_call>' }}\n {%- else %}\n {{- '<tool_call>\\n{\"name\": ' + tool_call.name|tojson + ', \"arguments\": ' }}\n {%- if tool_call.arguments is string %}\n {{- tool_call.arguments }}\n {%- else %}\n {{- tool_call.arguments | tojson | safe }}\n {%- endif %}\n {{- '}\\n</tool_call>' }}\n {%- endif %}\n {%- endfor %}\n {%- endif %}\n {{- '<|im_end|>\\n' }}\n {%- elif message.role == \"tool\" %}\n {%- if loop.previtem and loop.previtem.role != \"tool\" %}\n {{- '<|im_start|>user' }}\n {%- endif %}\n {{- '\\n<tool_response>\\n' }}\n {{- content }}\n {{- '\\n</tool_response>' }}\n {%- if not loop.last and loop.nextitem.role != \"tool\" %}\n {{- '<|im_end|>\\n' }}\n {%- elif loop.last %}\n {{- '<|im_end|>\\n' }}\n {%- endif %}\n {%- else %}\n {{- raise_exception('Unexpected message role.') }}\n {%- endif %}\n{%- endfor %}\n{%- if add_generation_prompt %}\n {{- '<|im_start|>assistant\\n' }}\n {%- if enable_thinking is defined and enable_thinking is false %}\n {{- '<think>\\n\\n</think>\\n\\n' }}\n {%- else %}\n {{- '<think>\\n' }}\n {%- endif %}\n{%- endif %}\n{%- endif %}\n"
|
| 300 |
+
}
|