🚀 QwQ-32B量化模型
本项目是基于GPTQ技术对Qwen/QwQ-32B模型进行量化后的成果,可用于文本生成任务,在降低模型存储和计算成本的同时,保持了较好的性能。
🚀 快速开始
环境准备
确保你已经安装了必要的库,如transformers
和gptqmodel
。
代码示例
from transformers import AutoTokenizer
from gptqmodel import GPTQModel
tokenizer = AutoTokenizer.from_pretrained("ModelCloud/QwQ-32B-gptqmodel-4bit-vortex-v1")
model = GPTQModel.load("ModelCloud/QwQ-32B-gptqmodel-4bit-vortex-v1")
messages = [
{"role": "user", "content": "How many r's are in the word \"strawberry\""},
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=512)
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)
✨ 主要特性
- 量化技术:使用GPTQModel进行量化,将模型量化为4位,有效降低存储和计算成本。
- 多参数配置:支持多种量化参数配置,如
group_size
、desc_act
等,可根据需求进行调整。
📦 安装指南
暂未提供相关安装步骤,你可以根据transformers
和gptqmodel
的官方文档进行安装。
💻 使用示例
基础用法
from transformers import AutoTokenizer
from gptqmodel import GPTQModel
tokenizer = AutoTokenizer.from_pretrained("ModelCloud/QwQ-32B-gptqmodel-4bit-vortex-v1")
model = GPTQModel.load("ModelCloud/QwQ-32B-gptqmodel-4bit-vortex-v1")
messages = [
{"role": "user", "content": "How many r's are in the word \"strawberry\""},
]
input_tensor = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=512)
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
print(result)
高级用法
目前暂未提供高级用法示例,你可以根据实际需求对代码进行扩展。
📚 详细文档
模型信息
属性 |
详情 |
基础模型 |
Qwen/QwQ-32B |
任务类型 |
文本生成 |
标签 |
gptqmodel、modelcloud、chat、qwen2、qwq、instruct、int4、gptq、4bit |
量化参数
参数 |
值 |
量化位数 |
4 |
动态量化 |
null |
分组大小 |
32 |
激活描述 |
true |
静态分组 |
false |
对称量化 |
true |
语言模型头量化 |
false |
真正顺序量化 |
true |
量化方法 |
gptq |
检查点格式 |
gptq |
元信息
参数 |
值 |
量化器 |
gptqmodel:2.0.0 |
量化器链接 |
https://github.com/modelcloud/gptqmodel |
阻尼百分比 |
0.1 |
阻尼自动增量 |
0.0025 |
📄 许可证
本模型使用Apache-2.0许可证。