模型概述
模型特點
模型能力
使用案例
🚀 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 |



