QwQ is the reasoning model of the Qwen series. Compared with conventional instruction-tuned models, QwQ, which is capable of thinking and reasoning, can achieve significantly enhanced performance in downstream tasks, especially hard problems. QwQ-32B is the medium-sized reasoning model, which is capable of achieving competitive performance against state-of-the-art reasoning models, e.g., DeepSeek-R1, o1-mini. QwQ-R1984-32B is an enhanced version based on QwQ-32B that incorporates additional features such as uncensored capabilities and deep research functionality. This allows for more unrestricted responses and in-depth information provision based on real-time web searches.
Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "VIDraft/QwQ-R1984-32B"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "How many r's are in the word \"strawberry\""
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=32768
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)
model-00001-of-00014.safetensors 4.6 GiBmodel-00004-of-00014.safetensors 4.5 GiBmodel-00005-of-00014.safetensors 4.5 GiBmodel-00006-of-00014.safetensors 4.5 GiBmodel-00007-of-00014.safetensors 4.5 GiBmodel-00008-of-00014.safetensors 4.5 GiBmodel-00009-of-00014.safetensors 4.5 GiBmodel-00010-of-00014.safetensors 4.5 GiBmodel-00011-of-00014.safetensors 4.5 GiBmodel-00012-of-00014.safetensors 4.5 GiBmodel-00013-of-00014.safetensors 4.5 GiBmodel-00003-of-00014.safetensors 4.5 GiBmodel-00002-of-00014.safetensors 4.5 GiBmodel-00014-of-00014.safetensors 2.0 GiB