模型简介
模型特点
模型能力
使用案例
🚀 WizardCoder Python 13B V1.0 - GPTQ
本项目提供了 WizardLM's WizardCoder Python 13B V1.0 的GPTQ模型文件,包含多种GPTQ参数排列组合,可根据自身硬件和需求选择最佳参数。

TheBloke's LLM work is generously supported by a grant from andreessen horowitz (a16z)
🚀 快速开始
模型信息
属性 | 详情 |
---|---|
模型创建者 | WizardLM |
模型类型 | llama |
基础模型 | WizardLM/WizardCoder-Python-13B-V1.0 |
许可证 | llama2 |
训练指标 | code_eval |
提示模板 | Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: {prompt} ### Response: |
可用仓库
- AWQ模型(用于GPU推理)
- GPTQ模型(用于GPU推理,提供多种量化参数选项)
- 2、3、4、5、6和8位的GGUF模型(用于CPU+GPU推理)
- WizardLM原始未量化的fp16 PyTorch格式模型(用于GPU推理和进一步转换)
提示模板:Alpaca
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
📦 安装指南
从不同分支下载
- 在
text-generation-webui
中,可在下载名称后添加:branch
,例如TheBloke/WizardCoder-Python-13B-V1.0-GPTQ:main
- 使用Git克隆分支:
git clone --single-branch --branch main https://huggingface.co/TheBloke/WizardCoder-Python-13B-V1.0-GPTQ
- 在Python Transformers代码中,使用
revision
参数指定分支
在 text-generation-webui
中下载和使用模型
- 确保使用的是 text-generation-webui 的最新版本,强烈建议使用一键安装程序。
- 点击 Model tab。
- 在 Download custom model or LoRA 中输入
TheBloke/WizardCoder-Python-13B-V1.0-GPTQ
,若要从特定分支下载,可输入TheBloke/WizardCoder-Python-13B-V1.0-GPTQ:main
。 - 点击 Download,等待下载完成。
- 点击左上角 Model 旁边的刷新图标。
- 在 Model 下拉菜单中选择刚下载的模型
WizardCoder-Python-13B-V1.0-GPTQ
。 - 模型将自动加载,即可开始使用。
- 若需要自定义设置,设置完成后点击右上角的 Save settings for this model 再点击 Reload the Model。
- 点击 Text Generation tab 输入提示词开始使用。
使用Python代码使用GPTQ模型
安装必要的包
需要 Transformers 4.32.0
或更高版本、Optimum 1.12.0
或更高版本以及 AutoGPTQ 0.4.2
或更高版本。
pip3 install transformers>=4.32.0 optimum>=1.12.0
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # Use cu117 if on CUDA 11.7
若使用预构建的轮子安装 AutoGPTQ
有问题,可从源代码安装:
pip3 uninstall -y auto-gptq
git clone https://github.com/PanQiWei/AutoGPTQ
cd AutoGPTQ
pip3 install .
对于CodeLlama模型
必须使用 Transformers 4.33.0
或更高版本,若尚未发布,可从源代码安装:
pip3 uninstall -y transformers
pip3 install git+https://github.com/huggingface/transformers.git
使用示例代码
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_name_or_path = "TheBloke/WizardCoder-Python-13B-V1.0-GPTQ"
# To use a different branch, change revision
# For example: revision="main"
model = AutoModelForCausalLM.from_pretrained(model_name_or_path,
device_map="auto",
trust_remote_code=False,
revision="main")
tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
prompt = "Tell me about AI"
prompt_template=f'''Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
'''
print("\n\n*** Generate:")
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
print(tokenizer.decode(output[0]))
# Inference can also be done using transformers' pipeline
print("*** Pipeline:")
pipe = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
repetition_penalty=1.1
)
print(pipe(prompt_template)[0]['generated_text'])
🔧 技术细节
提供的文件和GPTQ参数
提供了多种量化参数,每个单独的量化在不同分支中,可根据硬件和需求选择最佳参数。所有最近的GPTQ文件使用 AutoGPTQ
制作,非主分支的文件也使用 AutoGPTQ
制作,main
分支中2023年8月之前上传的文件使用 GPTQ-for-LLaMa
制作。
GPTQ参数说明
- Bits:量化模型的位大小。
- GS:GPTQ组大小,较高的数字使用较少的VRAM,但量化精度较低,"None" 是最低可能值。
- Act Order:真或假,也称为
desc_act
,真可提高量化精度,一些GPTQ客户端在使用Act Order和Group Size的模型时可能会有问题,但现在一般已解决。 - Damp %:影响量化样本处理的GPTQ参数,默认值为0.01,但0.1可提高一点精度。
- GPTQ数据集:用于量化的数据集,使用更适合模型训练的数据集可提高量化精度,注意GPTQ数据集与训练模型的数据集不同。
- 序列长度:用于量化的数据集序列长度,理想情况下应与模型序列长度相同,对于一些非常长序列的模型(16+K),可能需要使用较低的序列长度,较低的序列长度不会限制量化模型的序列长度,仅影响较长推理序列的量化精度。
- ExLlama兼容性:该文件是否可使用ExLlama加载,目前ExLlama仅支持4位的Llama模型。
分支 | Bits | GS | Act Order | Damp % | GPTQ数据集 | Seq Len | 大小 | ExLlama | 描述 |
---|---|---|---|---|---|---|---|---|---|
main | 4 | 128 | 否 | 0.1 | Evol Instruct Code | 8192 | 7.26 GB | 是 | 4位,无Act Order,组大小128g。 |
gptq-4bit-32g-actorder_True | 4 | 32 | 是 | 0.1 | Evol Instruct Code | 8192 | 8.00 GB | 是 | 4位,有Act Order,组大小32g,可提供最高的推理质量,但使用最大的VRAM。 |
gptq-4bit-64g-actorder_True | 4 | 64 | 是 | 0.1 | Evol Instruct Code | 8192 | 7.51 GB | 是 | 4位,有Act Order,组大小64g,比32g使用更少的VRAM,但精度略低。 |
gptq-4bit-128g-actorder_True | 4 | 128 | 是 | 0.1 | Evol Instruct Code | 8192 | 7.26 GB | 是 | 4位,有Act Order,组大小128g,比64g使用更少的VRAM,但精度略低。 |
gptq-8bit--1g-actorder_True | 8 | 无 | 是 | 0.1 | Evol Instruct Code | 8192 | 13.36 GB | 否 | 8位,有Act Order,无组大小,以降低VRAM需求。 |
gptq-8bit-128g-actorder_True | 8 | 128 | 是 | 0.1 | Evol Instruct Code | 8192 | 13.65 GB | 否 | 8位,组大小128g以提高推理质量,有Act Order以提高精度。 |
兼容性
提供的文件经测试可与 AutoGPTQ
配合使用,无论是通过 Transformers
还是直接使用 AutoGPTQ
,也应与 Occ4m's GPTQ-for-LLaMa fork 兼容。ExLlama 与4位的Llama模型兼容,Huggingface Text Generation Inference (TGI) 与所有GPTQ模型兼容。
📄 许可证
本模型使用 llama2 许可证。
Discord
如需进一步支持,或讨论这些模型和人工智能相关话题,可加入 TheBloke AI's Discord服务器。
感谢与贡献
感谢 chirper.ai 团队和 gpus.llm-utils.org 的Clay!
如果您愿意贡献,将不胜感激,这将帮助提供更多模型并开展新的人工智能项目。捐赠者将在所有AI/LLM/模型问题和请求上获得优先支持,访问私人Discord房间等福利。
- Patreon: https://patreon.com/TheBlokeAI
- Ko-Fi: https://ko-fi.com/TheBlokeAI
特别感谢:Aemon Algiz。
Patreon特别提及:Alicia Loh, Stephen Murray, K, Ajan Kanaga, RoA, Magnesian, Deo Leter, Olakabola, Eugene Pentland, zynix, Deep Realms, Raymond Fosdick, Elijah Stavena, Iucharbius, Erik Bj√§reholt, Luis Javier Navarrete Lozano, Nicholas, theTransient, John Detwiler, alfie_i, knownsqashed, Mano Prime, Willem Michiel, Enrico Ros, LangChain4j, OG, Michael Dempsey, Pierre Kircher, Pedro Madruga, James Bentley, Thomas Belote, Luke @flexchar, Leonard Tan, Johann-Peter Hartmann, Illia Dulskyi, Fen Risland, Chadd, S_X, Jeff Scroggin, Ken Nordquist, Sean Connelly, Artur Olbinski, Swaroop Kallakuri, Jack West, Ai Maven, David Ziegler, Russ Johnson, transmissions 11, John Villwock, Alps Aficionado, Clay Pascal, Viktor Bowallius, Subspace Studios, Rainer Wilmers, Trenton Dambrowitz, vamX, Michael Levine, ϧÄ͵ê ÍπÄ, Brandon Frisco, Kalila, Trailburnt, Randy H, Talal Aujan, Nathan Dryer, Vadim, ÈòøÊòé, ReadyPlayerEmma, Tiffany J. Kim, George Stoitzev, Spencer Kim, Jerry Meng, Gabriel Tamborski, Cory Kujawski, Jeffrey Morgan, Spiking Neurons AB, Edmond Seymore, Alexandros Triantafyllidis, Lone Striker, Cap'n Zoog, Nikolai Manek, danny, ya boyyy, Derek Yates, usrbinkat, Mandus, TL, Nathan LeClaire, subjectnull, Imad Khwaja, webtim, Raven Klaugh, Asp the Wyvern, Gabriel Puliatti, Caitlyn Gatomon, Joseph William Delisle, Jonathan Leane, Luke Pendergrass, SuperWojo, Sebastain Graf, Will Dee, Fred von Graf, Andrey, Dan Guido, Daniel P. Andersen, Nitin Borwankar, Elle, Vitor Caleffi, biorpg, jjj, NimbleBox.ai, Pieter, Matthew Berman, terasurfer, Michael Davis, Alex, Stanislav Ovsiannikov
感谢所有慷慨的赞助者和捐赠者!再次感谢a16z的慷慨资助!
原始模型卡片:WizardLM's WizardCoder Python 13B V1.0
HF Repo • Github Repo • Twitter • [WizardLM] • [WizardCoder] • [WizardMath]
新闻
- [2023/08/26] 发布 WizardCoder-Python-34B-V1.0,在 HumanEval Benchmarks 上达到 73.2 pass@1,超越 GPT4 (2023/03/15)、ChatGPT-3.5 和 Claude2。
- [2023/06/16] 发布 WizardCoder-15B-V1.0,在 HumanEval Benchmarks 上达到 57.3 pass@1,超越 Claude-Plus (+6.8)、Bard (+15.3) 和 InstructCodeT5+ (+22.3)。
注意:GPT4和ChatGPT-3.5有两个HumanEval结果,67.0和48.1由 OpenAI 的官方GPT4报告(2023/03/15)报告,82.0和72.5是我们使用最新API(2023/08/26)测试的结果。
模型 | 检查点 | 论文 | HumanEval | MBPP | 演示 | 许可证 |
---|---|---|---|---|---|---|
WizardCoder-Python-34B-V1.0 | HF链接 | [WizardCoder] | 73.2 | 61.2 | 演示 | Llama2 |
WizardCoder-15B-V1.0 | HF链接 | [WizardCoder] | 59.8 | 50.6 | -- | OpenRAIL-M |
WizardCoder-Python-13B-V1.0 | HF链接 | [WizardCoder] | 64.0 | 55.6 | -- | Llama2 |
WizardCoder-Python-7B-V1.0 | HF链接 | [WizardCoder] | 55.5 | 51.6 | 演示 | Llama2 |
WizardCoder-3B-V1.0 | HF链接 | [WizardCoder] | 34.8 | 37.4 | -- | OpenRAIL-M |
WizardCoder-1B-V1.0 | HF链接 | [WizardCoder] | 23.8 | 28.6 | -- | OpenRAIL-M |
- WizardMath-70B-V1.0 模型在GSM8K上略优于一些闭源大语言模型,包括 ChatGPT 3.5、Claude Instant 1 和 PaLM 2 540B。
- WizardMath-70B-V1.0 模型在 GSM8k Benchmarks 上达到 81.6 pass@1,比当前最先进的开源大语言模型高 24.8 分,在 MATH Benchmarks 上达到 22.7 pass@1,比当前最先进的开源大语言模型高 9.2 分。
模型 | 检查点 | 论文 | GSM8k | MATH | 在线演示 | 许可证 |
---|---|---|---|---|---|---|
WizardMath-70B-V1.0 | HF链接 | [WizardMath] | 81.6 | 22.7 | 演示 | Llama2 |



