模型简介
模型特点
模型能力
使用案例
🚀 Athnete 13B - GPTQ
本项目提供了IkariDev的Athnete 13B模型的GPTQ量化版本,支持多种推理方式,满足不同硬件和需求。
🚀 快速开始
本仓库包含了IkariDev的Athnete 13B的GPTQ模型文件。提供了多种GPTQ参数排列组合,详情请见下方的“提供的文件和GPTQ参数”部分。
这些文件是在Massed Compute提供的硬件上进行量化的。
✨ 主要特性
- 多版本支持:提供了AWQ、GPTQ、GGUF等多种量化版本,适用于不同的推理场景。
- 参数可选:每个独立的量化版本位于不同的分支,用户可以根据自己的硬件和需求选择最佳的量化参数。
- 广泛兼容:已知可在多个推理服务器和Web UI中使用,如text-generation-webui、KobaldAI United等。
📦 安装指南
在text-generation-webui中下载
- 从
main
分支下载:在“下载模型”框中输入TheBloke/Athnete-13B-GPTQ
。 - 从其他分支下载:在下载名称末尾添加
:branchname
,例如TheBloke/Athnete-13B-GPTQ:gptq-4bit-32g-actorder_True
。
从命令行下载
推荐使用huggingface-hub
Python库:
pip3 install huggingface-hub
- 下载
main
分支到名为Athnete-13B-GPTQ
的文件夹:
mkdir Athnete-13B-GPTQ
huggingface-cli download TheBloke/Athnete-13B-GPTQ --local-dir Athnete-13B-GPTQ --local-dir-use-symlinks False
- 从不同分支下载:添加
--revision
参数,例如:
mkdir Athnete-13B-GPTQ
huggingface-cli download TheBloke/Athnete-13B-GPTQ --revision gptq-4bit-32g-actorder_True --local-dir Athnete-13B-GPTQ --local-dir-use-symlinks False
使用git
下载(不推荐)
使用以下命令克隆特定分支:
git clone --single-branch --branch gptq-4bit-32g-actorder_True https://huggingface.co/TheBloke/Athnete-13B-GPTQ
💻 使用示例
在text-generation-webui中使用
- 确保使用的是text-generation-webui的最新版本。
- 强烈建议使用一键安装程序,除非你确定知道如何手动安装。
- 点击“模型”选项卡。
- 在“下载自定义模型或LoRA”下,输入
TheBloke/Athnete-13B-GPTQ
。- 若要从特定分支下载,可输入例如
TheBloke/Athnete-13B-GPTQ:gptq-4bit-32g-actorder_True
。 - 具体分支列表见“提供的文件和GPTQ参数”部分。
- 若要从特定分支下载,可输入例如
- 点击“下载”。
- 模型开始下载,完成后会显示“完成”。
- 在左上角,点击“模型”旁边的刷新图标。
- 在“模型”下拉菜单中,选择刚下载的模型:
Athnete-13B-GPTQ
。 - 模型将自动加载,即可开始使用!
- 若需要自定义设置,设置完成后点击“保存此模型的设置”,然后在右上角点击“重新加载模型”。
从Python代码中使用
安装必要的包
需要安装Transformers 4.33.0或更高版本、Optimum 1.12.0或更高版本,以及AutoGPTQ 0.4.2或更高版本:
pip3 install transformers optimum
pip3 install auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/ # 若使用CUDA 11.7,使用cu117
若使用预构建的轮子安装AutoGPTQ时遇到问题,可从源代码安装:
pip3 uninstall -y auto-gptq
git clone https://github.com/PanQiWei/AutoGPTQ
cd AutoGPTQ
git checkout v0.4.2
pip3 install .
使用代码示例
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_name_or_path = "TheBloke/Athnete-13B-GPTQ"
# 若要使用不同分支,更改revision参数
# 例如:revision="gptq-4bit-32g-actorder_True"
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]))
# 也可以使用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'])
从Text Generation Inference (TGI)中使用
推荐使用TGI版本1.1.0或更高版本,官方Docker容器为:ghcr.io/huggingface/text-generation-inference:1.1.0
。
示例Docker参数
--model-id TheBloke/Athnete-13B-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
示例Python代码
pip3 install huggingface-hub
from huggingface_hub import InferenceClient
endpoint_url = "https://your-endpoint-url-here"
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:
'''
client = InferenceClient(endpoint_url)
response = client.text_generation(prompt,
max_new_tokens=128,
do_sample=True,
temperature=0.7,
top_p=0.95,
top_k=40,
repetition_penalty=1.1)
print(f"Model output: {response}")
📚 详细文档
可用的仓库
- 适用于GPU推理的AWQ模型
- 具有多个量化参数选项的GPTQ模型,用于GPU推理
- 适用于CPU+GPU推理的2、3、4、5、6和8位GGUF模型
- IkariDev的原始未量化fp16模型,采用pytorch格式,用于GPU推理和进一步转换
提示模板:Alpaca
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
许可证
源模型的创建者将其许可证列为cc-by-nc-4.0
,因此此量化版本也使用相同的许可证。
由于此模型基于Llama 2,它也受Meta Llama 2许可条款的约束,并且额外包含了相关的许可文件。因此,应认为该模型声称同时受这两个许可证的约束。我已联系Hugging Face以澄清双重许可问题,但他们目前尚未有官方立场。如果情况发生变化,或者Meta对此情况提供任何反馈,我将相应更新此部分内容。
在此期间,任何关于许可的问题,特别是这两个许可证可能如何相互作用的问题,应直接咨询原始模型仓库:IkariDev的Athnete 13B。
已知兼容的客户端/服务器
这些GPTQ模型已知可在以下推理服务器/Web UI中使用:
这可能不是完整的列表,如果您知道其他兼容的客户端/服务器,请告知!
提供的文件和GPTQ参数
提供了多个量化参数,以便您根据自己的硬件和需求选择最佳参数。
每个独立的量化版本位于不同的分支。有关从不同分支获取文件的说明,请见下文。
大多数GPTQ文件使用AutoGPTQ制作,Mistral模型目前使用Transformers制作。
GPTQ参数说明
- 比特数(Bits):量化模型的位大小。
- 分组大小(GS):GPTQ分组大小。较高的数值使用较少的VRAM,但量化精度较低。“None”是最低可能值。
- 激活顺序(Act Order):真或假。也称为
desc_act
。设置为真可获得更好的量化精度。一些GPTQ客户端在使用激活顺序和分组大小的模型时遇到过问题,但现在通常已解决。 - 阻尼百分比(Damp %):一个影响量化样本处理方式的GPTQ参数。默认值为0.01,但0.1可获得稍高的精度。
- GPTQ数据集:量化期间使用的校准数据集。使用与模型训练更匹配的数据集可以提高量化精度。请注意,GPTQ校准数据集与训练模型使用的数据集不同 - 请参考原始模型仓库了解训练数据集的详细信息。
- 序列长度(Sequence Length):量化期间使用的数据集序列长度。理想情况下,此值应与模型序列长度相同。对于一些非常长序列的模型(16K以上),可能需要使用较低的序列长度。请注意,较低的序列长度不会限制量化模型的序列长度,它仅影响较长推理序列的量化精度。
- ExLlama兼容性:此文件是否可以使用ExLlama加载,目前ExLlama仅支持4位的Llama和Mistral模型。
分支 | 比特数 | 分组大小 | 激活顺序 | 阻尼百分比 | GPTQ数据集 | 序列长度 | 大小 | ExLlama兼容性 | 描述 |
---|---|---|---|---|---|---|---|---|---|
main | 4 | 128 | 是 | 0.1 | wikitext | 4096 | 7.26 GB | 是 | 4位,带有激活顺序和分组大小128g。比64g使用更少的VRAM,但精度稍低。 |
gptq-4bit-32g-actorder_True | 4 | 32 | 是 | 0.1 | wikitext | 4096 | 8.00 GB | 是 | 4位,带有激活顺序和分组大小32g。可获得最高的推理质量,但使用最大的VRAM。 |
gptq-8bit--1g-actorder_True | 8 | 无 | 是 | 0.1 | wikitext | 4096 | 13.36 GB | 否 | 8位,带有激活顺序。无分组大小,以降低VRAM需求。 |
gptq-8bit-128g-actorder_True | 8 | 128 | 是 | 0.1 | wikitext | 4096 | 13.65 GB | 否 | 8位,分组大小128g以提高推理质量,带有激活顺序以获得更高的精度。 |
gptq-8bit-32g-actorder_True | 8 | 32 | 是 | 0.1 | wikitext | 4096 | 14.54 GB | 否 | 8位,分组大小32g和激活顺序以获得最大的推理质量。 |
gptq-4bit-64g-actorder_True | 4 | 64 | 是 | 0.1 | wikitext | 4096 | 7.51 GB | 是 | 4位,带有激活顺序和分组大小64g。比32g使用更少的VRAM,但精度稍低。 |
兼容性
提供的文件已测试可与Transformers一起使用。对于非Mistral模型,也可以直接使用AutoGPTQ。
ExLlama与4位的Llama和Mistral模型兼容。请参阅上方的“提供的文件”表格,了解每个文件的兼容性。
有关客户端/服务器列表,请参阅“已知兼容的客户端/服务器”部分。
📄 许可证
本项目遵循cc-by-nc-4.0
许可证,同时由于基于Llama 2,也受Meta Llama 2许可条款的约束。
🔗 相关链接
Discord
如需进一步支持,以及讨论这些模型和人工智能相关话题,请加入我们的: TheBloke AI的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特别提及:Brandon Frisco、LangChain4j、Spiking Neurons AB、transmissions 11、Joseph William Delisle、Nitin Borwankar、Willem Michiel、Michael Dempsey、vamX、Jeffrey Morgan、zynix、jjj、Omer Bin Jawed、Sean Connelly、jinyuan sun、Jeromy Smith、Shadi、Pawan Osman、Chadd、Elijah Stavena、Illia Dulskyi、Sebastain Graf、Stephen Murray、terasurfer、Edmond Seymore、Celu Ramasamy、Mandus、Alex、biorpg、Ajan Kanaga、Clay Pascal、Raven Klaugh、阿明、K、ya boyyy、usrbinkat、Alicia Loh、John Villwock、ReadyPlayerEmma、Chris Smitley、Cap'n Zoog、fincy、GodLy、S_X、sidney chen、Cory Kujawski、OG、Mano Prime、AzureBlack、Pieter、Kalila、Spencer Kim、Tom X Nguyen、Stanislav Ovsiannikov、Michael Levine、Andrey、Trailburnt、Vadim、Enrico Ros、Talal Aujan、Brandon Phillips、Jack West、Eugene Pentland、Michael Davis、Will Dee、webtim、Jonathan Leane、Alps Aficionado、Rooh Singh、Tiffany J. Kim、theTransient、Luke @flexchar、Elle、Caitlyn Gatomon、Ari Malik、subjectnull、Johann-Peter Hartmann、Trenton Dambrowitz、Imad Khwaja、Asp the Wyvern、Emad Mostaque、Rainer Wilmers、Alexandros Triantafyllidis、Nicholas、Pedro Madruga、SuperWojo、Harry Royden McLaughlin、James Bentley、Olakabola、David Ziegler、Ai Maven、Jeff Scroggin、Nikolai Manek、Deo Leter、Matthew Berman、Fen Risland、Ken Nordquist、Manuel Alberto Morcote、Luke Pendergrass、TL、Fred von Graf、Randy H、Dan Guido、NimbleBox.ai、Vitor Caleffi、Gabriel Tamborski、knownsqashed、Lone Striker、Erik Bjäreholt、John Detwiler、Leonard Tan、Iucharbius
感谢所有慷慨的赞助者和捐赠者! 再次感谢a16z的慷慨资助。
🔍 原始模型卡片:IkariDev的Athnete 13B
Athnete模型。使用Alpaca格式。适用于角色扮演(RP)、情感角色扮演(ERP)和一般任务。
尽管我制作的横幅很糟糕,但这个模型实际上可能比原始的Athena v3更好。
描述
本仓库包含Athnete的fp16文件。
模型和LoRA使用情况
- IkariDev/Athena-v3
- Undi95/Nete-13B
提示模板:Alpaca
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{prompt}
### Response:
非常感谢Undi95进行合并(合并方案是我的想法,他进行了合并)。



