Qwen/QwQ-32B 已完整同步
QwQ-32B
Introduction
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.
This repo contains the QwQ 32B model, which has the following features:
- Type: Causal Language Models
- Training Stage: Pretraining & Post-training (Supervised Finetuning and Reinforcement Learning)
- Architecture: transformers with RoPE, SwiGLU, RMSNorm, and Attention QKV bias
- Number of Parameters: 32.5B
- Number of Paramaters (Non-Embedding): 31.0B
- Number of Layers: 64
- Number of Attention Heads (GQA): 40 for Q and 8 for KV
- Context Length: Full 131,072 tokens
- For prompts exceeding 8,192 tokens in length, you must enable YaRN as outlined in this section.
Note: For the best experience, please review the usage guidelines before deploying QwQ models.
You can try our demo or access QwQ models via QwenChat.
For more details, please refer to our blog, GitHub, and Documentation.
Requirements
QwQ is based on Qwen2.5, whose code has been in the latest Hugging face transformers. We advise you to use the latest version of transformers.
With transformers<4.37.0, you will encounter the following error:
KeyError: 'qwen2'
Quickstart
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 = "Qwen/QwQ-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)
Usage Guidelines
To achieve optimal performance, we recommend the following settings:
-
Enforce Thoughtful Output: Ensure the model starts with "<think>\n" to prevent generating empty thinking content, which can degrade output quality. If you use
apply_chat_templateand setadd_generation_prompt=True, this is already automatically implemented, but it may cause the response to lack the <think> tag at the beginning. This is normal behavior. -
Sampling Parameters:
- Use Temperature=0.6, TopP=0.95, MinP=0 instead of Greedy decoding to avoid endless repetitions.
- Use TopK between 20 and 40 to filter out rare token occurrences while maintaining the diversity of the generated output.
- For supported frameworks, you can adjust the
presence_penaltyparameter between 0 and 2 to r
27 个文件
浏览文件数据集版权信息
本数据集的许可证为 Apache License 2.0。如有违反相关条款,请联系 WEHUB,我们将及时处理。 查看许可证
通过 WeHub CLI 下载当前数据集快照。下列命令会固定为当前页面展示的数据版本(如果页面提供版本)。文件字节由本机直连存储下载,浏览器不会签发或保存下载链接。
前置要求
需要 Node.js 18 及以上,以及 npm(或 npx)。
1. 安装 CLI
npm install -g wehub-cli@latest
2. 下载此数据集
wehub datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa
若中断或部分失败,在同一目录重新执行同一命令即可续传。默认会校验 SHA-256。
免全局安装
npx --yes wehub-cli@latest datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa
高级选项
以下为 wehub datasets download 已支持的参数示例:
强制重新下载,不复用已校验的本地文件
wehub datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa --overwrite
仅包含匹配路径
wehub datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa --include "*.jsonl"
排除匹配路径
wehub datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa --exclude "*.md"
提高并发下载数
wehub datasets download ds_ext_4974_3198b2c5aa --revision 976055f8c83f394f35dbd3ab09a285a984907bd0 --output ./ds_ext_4974_3198b2c5aa --jobs 8
完整帮助:wehub datasets download --help
