Text Generation
Transformers
Safetensors
English
Korean
Motif
text-generation-inference
conversational
custom_code
Instructions to use Motif-Technologies/Motif-2-12.7B-Reasoning with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Motif-Technologies/Motif-2-12.7B-Reasoning with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Motif-Technologies/Motif-2-12.7B-Reasoning", trust_remote_code=True) 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("Motif-Technologies/Motif-2-12.7B-Reasoning", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Motif-Technologies/Motif-2-12.7B-Reasoning with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Motif-Technologies/Motif-2-12.7B-Reasoning" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Motif-Technologies/Motif-2-12.7B-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Motif-Technologies/Motif-2-12.7B-Reasoning
- SGLang
How to use Motif-Technologies/Motif-2-12.7B-Reasoning 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 "Motif-Technologies/Motif-2-12.7B-Reasoning" \ --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": "Motif-Technologies/Motif-2-12.7B-Reasoning", "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 "Motif-Technologies/Motif-2-12.7B-Reasoning" \ --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": "Motif-Technologies/Motif-2-12.7B-Reasoning", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Motif-Technologies/Motif-2-12.7B-Reasoning with Docker Model Runner:
docker model run hf.co/Motif-Technologies/Motif-2-12.7B-Reasoning
Download chat_template.jinja from Motif-Technologies/Motif-2-12.7B-Reasoning: direct link, hf CLI and curl.
- Browser
- Download file 2.63 kB
-
https://huggingface.co/Motif-Technologies/Motif-2-12.7B-Reasoning/resolve/217efdb60733ecf5dfb466e04139c1cc2f2411b9/chat_template.jinja
- Command line
-
hf download hf://Motif-Technologies/Motif-2-12.7B-Reasoning@217efdb60733ecf5dfb466e04139c1cc2f2411b9/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/Motif-Technologies/Motif-2-12.7B-Reasoning/resolve/217efdb60733ecf5dfb466e04139c1cc2f2411b9/chat_template.jinja
2.63 kB
| <|beginoftext|><startofturn|> | |
| {%- set system_messages = messages | selectattr('role', 'equalto', 'system') | list %} | |
| <|system|> | |
| You are a deep thinking AI, you may use extremely long chains of thought to deeply consider the problem and deliberate with yourself via systematic reasoning processes to help come to a correct solution prior to answering. You should enclose your thoughts and internal monologue inside <think> </think> tags, and then provide your solution or response to the problem. | |
| Solve the following problem step by step. Put your final answer inside \\boxed{}. | |
| {% if system_messages %} | |
| {% for sm in system_messages %} | |
| {{ sm.content }} | |
| {% endfor %} | |
| {%- endif %} | |
| {% if tools is defined and tools %} | |
| # Tools | |
| You may call one or more functions to assist with the user query. | |
| You are provided with function signatures within <tools></tools> XML tags: | |
| <tools> | |
| {%- for tool in tools %} | |
| {{ tool | tojson }} | |
| {%- if not loop.last %} | |
| {%- endif %} | |
| {%- endfor %} | |
| </tools> | |
| Use this exact JSON schema for each tool call: | |
| {"properties":{"name":{"title":"Name","type":"string"},"arguments":{"title":"Arguments","type":"object"}},"required":["name","arguments"],"title":"FunctionCall","type":"object"} | |
| For each function call return a json object with function name and arguments within <tool_call></tool_call> XML tags as follows: | |
| <tool_call> | |
| {"name": <function-name>, "arguments": <args-dict>} | |
| </tool_call> | |
| {% endif %} | |
| {{ '<|endofturn|>' }} | |
| {%- for message in messages if message.role != "system" -%} | |
| <|startofturn|> | |
| {%- if message.role == "user" -%} | |
| <|user|> | |
| {{ message.content }} | |
| <|endofturn|>{%- elif message.role == "assistant" -%} | |
| <|assistant|> | |
| {%- set raw_calls = (message.tool_calls if (message.tool_calls is defined and message.tool_calls) else message.tool_call) %} | |
| {%- if raw_calls %} | |
| {%- set tool_calls = (raw_calls if (raw_calls is iterable and (raw_calls is not mapping) and (raw_calls is not string)) else [raw_calls]) %} | |
| {%- for tc in tool_calls %} | |
| {%- set call = (tc.function if tc.function is defined else tc) %} | |
| <tool_call> | |
| {"name": "{{ call.name }}", "arguments": {{ call.arguments if call.arguments is string else (call.arguments|default({})|tojson) }}} | |
| </tool_call> | |
| {%- endfor %} | |
| {%- endif %} | |
| {%- if message.thinking is defined and message.thinking %} | |
| {{ '<think>' }} | |
| {{ message.thinking }} | |
| {{ '</think>' }} | |
| {% endif %} | |
| {{ message.content }} | |
| <|endofturn|>{%- elif message.role == "tool" -%} | |
| <|tool|> | |
| <tool_response> | |
| {{ message.content }} | |
| </tool_response><|endofturn|> | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt %} | |
| {{- '<|assistant|><think>\n' }} | |
| {%- else %} | |
| <|endoftext|> | |
| {%- endif %} |