We are pleased to announce
Motif-2-12.7B-Instruct
, a 12.7-billion-parameter language model. This model is an
supervised fine-tuning (SFT)
variant
of our base model:
https://huggingface.co/Motif-Technologies/Motif-2-12.7B-Base
. Detailed information including technical report will be released later.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"Motif-Technologies/Motif-2-12.7B-Instruct",
trust_remote_code = True,
_attn_implementation = "flash_attention_2",
dtype = torch.bfloat16 # currently supports bf16 only, for efficiency
).cuda()
tokenizer = AutoTokenizer.from_pretrained(
"Motif-Technologies/Motif-2-12.7B-Instruct",
trust_remote_code = True,
)
query = "What is the capital city of South Korea?"
input_ids = tokenizer.apply_chat_template(
[
{'role': 'system', 'content': 'you are an helpful assistant'},
{'role': 'user', 'content': query},
],
add_generation_prompt = True,
enable_thinking = False, # or True
return_tensors='pt',
).cuda()
output = model.generate(input_ids, max_new_tokens=1024, pad_token_id=tokenizer.eos_token_id)
output = tokenizer.decode(output[0, input_ids.shape[-1]:], skip_special_tokens = False)
print(output)
outputs
# with enable_thinking=True, the model is FORCED to think.
Okay, the user is asking for the capital city of South Korea. Let me think. I know that South Korea's capital is Seoul. But wait, I should double-check to make sure I'm not mixing it up with other countries. For example, North Korea's capital is Pyongyang. So yes, South Korea's capital is definitely Seoul. I should just provide that as the answer.
</think>
The capital city of South Korea is **Seoul**.
<|endofturn|><|endoftext|>
# with enable_thinking=False, the model chooses to think or not. in this example, thinking is not worth it.
The capital city of South Korea is Seoul.
<|endofturn|><|endoftext|>
How to use in vllm
The
PR
adding support for the Motif model in the official vLLM package is currently under review.
In the meantime, to use our model with vLLM, please use the following container
image
.
Our model supports a sequence length of up to 32K tokens.
# run vllm api server
VLLM_ATTENTION_BACKEND="DIFFERENTIAL_FLASH_ATTN" vllm serve Motif-Technologies/Motif-2-12.7B-Instruct --trust-remote-code --data-parallel-size <gpu_count>
# sending requests with curl
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{ "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital city of South Korea?"} ], "temperature": 0.6, "skip_special_tokens": false, "chat_template_kwargs": { "enable_thinking": true } }'
Runs of Motif-Technologies Motif-2-12.7B-Instruct on huggingface.co
391
Total runs
0
24-hour runs
22
3-day runs
56
7-day runs
257
30-day runs
More Information About Motif-2-12.7B-Instruct huggingface.co Model
Motif-2-12.7B-Instruct huggingface.co is an AI model on huggingface.co that provides Motif-2-12.7B-Instruct's model effect (), which can be used instantly with this Motif-Technologies Motif-2-12.7B-Instruct model. huggingface.co supports a free trial of the Motif-2-12.7B-Instruct model, and also provides paid use of the Motif-2-12.7B-Instruct. Support call Motif-2-12.7B-Instruct model through api, including Node.js, Python, http.
Motif-2-12.7B-Instruct huggingface.co is an online trial and call api platform, which integrates Motif-2-12.7B-Instruct's modeling effects, including api services, and provides a free online trial of Motif-2-12.7B-Instruct, you can try Motif-2-12.7B-Instruct online for free by clicking the link below.
Motif-Technologies Motif-2-12.7B-Instruct online free url in huggingface.co:
Motif-2-12.7B-Instruct is an open source model from GitHub that offers a free installation service, and any user can find Motif-2-12.7B-Instruct on GitHub to install. At the same time, huggingface.co provides the effect of Motif-2-12.7B-Instruct install, users can directly use Motif-2-12.7B-Instruct installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Motif-2-12.7B-Instruct install url in huggingface.co: