初始化项目,由ModelHub XC社区提供模型

Model: TheBloke/Yi-34B-Chat-GPTQ
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-09-21 11:40:18 +08:00
commit 41c6399e44
11 changed files with 1368 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
model.safetensors filter=lfs diff=lfs merge=lfs -text

324
LICENSE Normal file
View File

@@ -0,0 +1,324 @@
Yi Series Models Community License Agreement
Version: 2.1
Date of Release: November 23, 2023
1. Definition
“Agreement” refers to the terms and conditions defined in this Yi Series Models
Community License Agreement for the use, reproduction and distribution of Yi
Series Models.
“Model” refers to associated components (including checkpoints) developed based
on machine learning, including learned weights and parameters (including the
status of optimizer).
“Yi Series Models” refers to opensource models with different specifications and
capabilities named “Yi” provided by the Licensor, including Yi-6B, Yi-34B etc.
“Derivatives” refers to all modifications to Yi Series Models, work based on Yi
Series Models, or any other models created or initialized by transferring the
weights, parameters, activations, or output patterns of Yi Series Models to
other models to achieve similar performance, including but not limited to
methods that require using intermediate data representations or generating
synthetic data based on Yi Series Models to train other models.
“Licensor” refers to Beijing Lingyiwanwu Information Technology Co., Ltd.
“you” refers to an individual or legal entity that exercises the license granted
by this Agreement and/or uses the Yi Series Models for any purpose and in any
field of use.
“Third Party” refers to any individuals, legal entities or non-legal
organizations other than you.
“Distribute” refers to transmitting, copying, publishing, or otherwise sharing
the Yi Series Models with third parties, including providing the Yi Series
Models through electronic or other remote means (such as any SaaS software or
PaaS software accessed via API or web access).
“Commercial Purposes” refers to the use of the Yi Series Models, directly or
indirectly, for the operation, promotion, revenue generation, or any other
profit-making purposes for entities or individuals.
“Laws and Regulations” refers to the laws and administrative regulations of the
mainland of the People's Republic of China (for the purposes of this Agreement
only, excluding Hong Kong, Macau, and Taiwan).
“Personal Information” refers to various information related to identified or
identifiable natural persons recorded electronically or by other means,
excluding information that has been anonymized.
“Logo” refers to any trademark, service mark, trade name, domain name, website
name, or other distinctive branding marks.
2. License and License Restrictions
The Licensor hereby grants you a non-exclusive, global, non-transferable,
non-sub-licensable, revocable, and royalty-free copyright license. You must
adhere to the following license restrictions:
1) Your use of the Yi Series Models must comply with the Laws and Regulations as
well as applicable legal requirements of other countries/regions, and respect
social ethics and moral standards, including but not limited to, not using the
Yi Series Models for purposes prohibited by Laws and Regulations as well as
applicable legal requirements of other countries/regions, such as harming
national security, promoting terrorism, extremism, inciting ethnic or racial
hatred, discrimination, violence, or pornography, and spreading false harmful
information.
2) You shall not, for military or unlawful purposes or in ways not allowed by
Laws and Regulations as well as applicable legal requirements of other
countries/regions, a) use, copy or Distribute the Yi Series Models, or b) create
complete or partial Derivatives of the Yi Series Models.
3) Your use of the Yi Series Models (including using the output of the Yi Series
Models) and the creation of Derivatives must not infringe upon the legitimate
rights of any Third Party, including but not limited to the rights of personal
rights such as the right to likeness, reputation, and privacy, as well as
intellectual property rights such as copyrights, patents, trade secrets, and
other property rights.
4) You must clearly attribute the source of the Yi Series Models to the Licensor
and provide a copy of this Agreement to any Third-Party users of the Yi Series
Models and Derivatives.
5) If you modify the Yi Series Models to create Derivatives, you must clearly
indicate the substantial modifications made, and these modifications shall not
violate the license restrictions of this Agreement. You shall not enable,
assist, or in any way facilitate Third Parties to violate the license
restrictions of this Agreement.
If you plan to use the Yi Series Models and Derivatives for Commercial Purposes,
please refer to the Registration Form of Yi Series Models for Commercial Purposes
(“Registration Form”), as provided in Attachment 1 of the Yi Series Models
Commercial License Agreement (available at https://www.lingyiwanwu.com/yi-license)
and send completed Registration Form to the email: yi@01.ai to complete the
registration and obtain the license for Commercial Purposes. If you obtained the
license for Commercial Purposes and use the Yi Series Models and Derivatives for
Commercial Purposes, you must comply with the afore-mentioned license restrictions
and restrictions specified under the Yi Series Models Commercial License Agreement.
3. Intellectual Property
The ownership of the Yi Series Models and their related intellectual property
rights is solely held by the Licensor.
In any circumstance, without the prior written consent of the Licensor, you are
not allowed to use any Logo associated with the Licensor. If your use of
Licensor's Logo in violation of this Agreement causes any losses to the Licensor
or others, you will bear full legal responsibility.
4. Disclaimer and Limitation of Liability
The Yi Series Models are provided "AS IS." The Licensor does not provide any
express or implied warranties for the Yi Series Models, including but not
limited to stability, ownership, merchantability, non-infringement, or fitness
for a specific purpose of the Yi Series Models and their output results. You
assume all responsibilities for the risks and consequences arising from the use,
reproduction, distribution of the Yi Series Models, and the creation of
Derivatives.
The Licensor complies with Laws and Regulations at all stages of model training,
maintaining the legality, authenticity, accuracy, objectivity, and diversity of
data and algorithms. The Licensor is not liable for any direct, indirect,
incidental consequences, and other losses or damages related to your use,
reproduction, and distribution of the Yi Series Models, and the creation of
Derivatives under this Agreement. This includes but is not limited to:
1) The Licensor is not responsible for data security risks resulting from your
use of the Yi Series Models.
2) The Yi Series Models may contain Personal Information. When you use Yi Series
Models, you acknowledge that you are the data processing entity as defined under
the Laws and Regulations responsible for determining the processing methods and
purposes of Personal Information. You must comply with legal requirements for
processing any Personal Information that may be contained in the Yi Series
Models and assume the associated legal responsibilities, as well as the risks
and consequences of processing Personal Information.
3) The Licensor is not liable for reputation risks arising from your use of the
Yi Series Models or the output results of the Yi Series Models.
4) The Licensor is not liable for intellectual property risks associated with
your use of the Yi Series Models’ output results.
If your use, reproduction, distribution of the Yi Series Models, or the creation
of Derivatives result in losses to the Licensor, the Licensor has the right to
seek compensation from you. For any claims made by Third Parties against the
Licensor related to your use, reproduction, and distribution of the Yi Series
Models, or the creation of Derivatives, the Licensor has the right to demand
that you defend, compensate, and indemnify the Licensor and protect the Licensor
from harm.
5. Dispute Resolution
The stipulation, effectiveness, interpretation, performance, modification, and
termination of the Agreement, the use, copy and Distribute of the Yi Series
Models, and dispute resolution associated with your use, copy and distribution
shall be governed by the laws of the mainland of the People's Republic of China
(for the purposes of this agreement only, excluding Hong Kong, Macau, and
Taiwan), and the application of conflict of laws is excluded.
Any disputes arising from the use, copy or distribution of the Yi Series Models
should first be resolved through amicable negotiations. If negotiations fail,
legal proceedings should be initiated in the People's Court at the location of
the Licensor.
6. Effectiveness and Termination of the Agreement
Your use of the Yi Series Models signifies that you have read and agreed to be
bound by the terms of the Agreement. The Agreement becomes effective from the
date of your use of the Yi Series Models and will terminate from the date you
cease using the Yi Series Models. If you violate any terms or restrictions in
the Agreement, the Licensor reserves the right to terminate the Agreement.
Upon termination of the Agreement, you must immediately cease using the Yi
Series Models. Section 4, "Disclaimer and Limitation of Liability," and Section
5, "Dispute Resolution," of this Agreement remain in effect after the
termination of this Agreement.
7. Updates to the Agreement and Contact Information
The Licensor reserves the right to update the Agreement from time to time. The
latest version of the Agreement will be posted by the Licensor through
https://01.ai.
For any questions related to licensing and copyright, please contact the
Licensor at yi@01.ai.
Yi系列模型社区许可协议
版本: 2.1
发布日期: 2023年11月23日
1. 定义
“协议”是指本协议中定义Yi系列模型使用、复制和分发的条款和条件。
“模型”是指任何附带的基于机器学习的组件(包括检查点),包括学习的权重、参数(包括优
化器状态)。
“Yi系列模型”是指许可方开源的以Yi命名的不同规格、不同能力的模型,包括
Yi-6B、Yi-34B等。
“模型衍生品”是指对Yi系列模型的所有修改、基于Yi系列模型的工作,或通过将Yi系列模型
的权重、参数、激活或输出模式转移到其他模型而创建或初始化的任何其他模型,以使其他
模型的性能与Yi系列模型类似,包括但不限于需要使用中间数据表示的提取方法或基于Yi系
列模型生成合成数据来训练其他模型的方法。
“许可方”是指北京零一万物信息技术有限公司。
“您”是指行使本协议授予的权限和/或出于任何目的和在任何使用领域使用Yi系列模型的个
人或法人实体。
“第三方”是指您之外的任何个人、法人实体或非法人组织。
“分发”是指向第三方传输、复制、发布或以其他方式共享Yi系列模型,包括将Yi系列模型作
为通过电子或其他远程方式(例如基于 API 或 Web 访问的任何 SaaS 软件或 PaaS 软
件)提供。
“商业用途”是指使用Yi系列模型,直接或间接为实体或个人进行运营、推广或产生收入,或
用于任何其他盈利目的。
“法律法规”是指中华人民共和国大陆地区(仅为本协议之目的,不包括香港、澳门和台湾)
的法律及行政法规。
“个人信息”是指以电子或者其他方式记录的与已识别或者可识别的自然人有关的各种信息,
不包括匿名化处理后的信息。
“标识” 是指任何商标、服务标记、商号、域名、网站名称或其他带有显著品牌特征的标记。
2. 许可及许可限制
许可方特此授予您非排他性、全球性、不可转让、不可再许可、可撤销、免版税的版权许可。
您必须满足如下许可限制条件:
1) 您对Yi系列模型的使用应遵守法律法规以及其他国家/地区适用的法律要求、尊重社会公
德和伦理道德。包括但不限于您不得将Yi系列模型用作危害国家安全、宣扬恐怖主义、极端
主义,宣扬民族及种族仇恨、歧视,暴力、色情,以及虚假有害信息等法律法规以及其他国
家/地区适用的法律要求禁止的目的。
2) 您不得出于军事或非法目的,或以法律法规以及其他国家/地区适用的法律要求所不允许
的方式 a) 使用、复制、或分发Yi系列模型; 或 b) 创建Yi系列模型的全部或部分衍生品。
3) 您对Yi系列模型的使用(包括使用Yi系列模型的输出)以及模型衍生品的创建不得侵犯
任何第三方的合法权益,包括但不限于他人肖像权、名誉权、隐私权等人格权,著作权、专
利权、商业秘密等知识产权,或其他财产权益。
4) 您必须向Yi系列模型及Yi系列模型衍生品的任何第三方使用者明确Yi系列模型的来源为
许可方并向其提供本协议的副本。
5) 若您修改Yi系列模型得到模型衍生品,您必须以显著的方式说明修改的内容,且上述修
改不得违反本协议的许可限制条件,也不能允许、协助或以其他方式使得第三方违反本协议
中的许可限制条件。
如果您计划将Yi系列模型及模型衍生品用作商业用途,请参见《Yi系列模型商用许可协议》
(参见:https://www.lingyiwanwu.com/yi-license)附件一《Yi系列模型商用登
记表》(“登记表”)并将填写完毕的登记表发送至 yi@01.ai 邮箱完成登记即可获得商用
许可。若您获得商用许可并将Yi系列模型及模型衍生品用作商业用途,您应满足许可方上述
许可限制条件及《Yi系列模型商用许可协议》中的商业许可限制。
3. 知识产权
Yi系列模型的所有权及其相关知识产权,由许可方单独所有。
在任何情况下,未经许可方事先书面同意,您不得以任何方式使用许可方的任何标识。由于
您违反本协议使用许可方的标识给许可方或他人造成损失的,由您承担全部法律责任。
4. 免责声明及责任限制
Yi系列模型按“原样”提供。许可方不对Yi系列模型提供任何明示或暗示的保证,包括但不限
于:模型及输出结果的稳定性、所有权、适销性、非侵权性、或特定用途适用性。您将对适
用、复制及分发Yi系列模型以及创建模型衍生品所产生的风险与后果承担所有责任。
许可方在模型训练的所有阶段都遵守法律法规,坚持维护数据和算法的合法、真实、准确、
客观和多样性。许可方不对您根据本协议使用、复制及分发Yi系列模型,以及创建模型衍生
品而产生或与之相关的任何直接、间接、附带的后果、以及其他损失或损害承担责任。包括
但不限于:
1) 许可方不承担您因使用Yi系列模型而导致的数据安全风险。
2) Yi系列模型中可能包含个人信息。在您使用Yi系列模型的过程中,您承认您为法律法规
定义下决定个人信息处理方式和目的的个人信息处理者。您应遵守法律法规要求处理Yi系列
模型中可能包含的个人信息,并承担相应的法律责任,以及处理个人信息的风险和后果。
3) 许可方不承担您使用Yi系列模型或模型输出结果而产生的声誉风险。
4) 许可方不承担您使用Yi系列模型的输出结果涉及的知识产权风险。
若由于您对Yi系列模型的使用、复制或分发,或者创建模型衍生品而导致许可方遭受损失,
许可方有权要求您对许可方的损失进行赔偿。对于任何第三方向许可方提出的因您使用、复
制或分发Yi系列模型或创建模型衍生品行为的相关索赔,许可方有权要求您为许可方进行辩
护、赔偿并使许可方免受损害。
5. 争议解决
协议的订立、效力、解释、履行、修改和终止,使用、复制和分发Yi系列模型以及争议解决
均适用中华人民共和国大陆地区(仅为本协议之目的,不包括香港、澳门和台湾)法律,并
排除冲突法的适用。
因使用、复制和分发Yi系列模型而发生的任何争议,各方应首先通过友好协商的方式加以解
决。协商不成时,应向许可方所在地人民法院提起诉讼。
6. 协议的生效及终止
您使用Yi系列模型即表示您已阅读并同意接受协议的约束。协议自您使用Yi系列模型之日起
生效并将在您停止使用Yi系列模型之日起终止。若您违反协议中的任何条款或限制,许可方
有权终止协议。
若协议终止,您需立即停止使用Yi系列模型。本协议第4条“免责声明及责任限制”及第5条
“争议解决”在协议终止后仍有效。
7. 协议更新及联系方式
许可方有权对协议进行不时更新。许可方将通过 https://01.ai 公布协议最新版本。有关
许可和版权的任何问题,请通过 yi@01.ai 与许可方联系。

835
README.md Normal file
View File

@@ -0,0 +1,835 @@
---
base_model: 01-ai/Yi-34B-Chat
inference: false
license: other
license_link: LICENSE
license_name: yi-license
model_creator: 01-ai
model_name: Yi 34B Chat
model_type: yi
pipeline_tag: text-generation
prompt_template: '<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'
quantized_by: TheBloke
widget:
- example_title: Yi-34B-Chat
output:
text: ' Hello! How can I assist you today?'
text: hi
- example_title: Yi-34B
output:
text: " an eerie sense that something is just not right\u2026\nBetween the two\
\ worlds lies The Forgotten Kingdom - home to creatures long since thought extinct\
\ and ancient magic so strong it defies belief! Only here can you find what\
\ has been lost for centuries: An Elixir Of Life which will restore youth and\
\ vitality if only those who seek its power are brave enough to face up against\
\ all manner of dangers lurking in this mysterious land! But beware; some say\
\ there may even exist powerful entities beyond our comprehension whose intentions\
\ towards humanity remain unclear at best ---- they might want nothing more\
\ than destruction itself rather then anything else from their quest after immortality\
\ (and maybe someone should tell them about modern medicine)? In any event though\
\ \u2013 one thing remains true regardless : whether or not success comes easy\
\ depends entirely upon how much effort we put into conquering whatever challenges\
\ lie ahead along with having faith deep down inside ourselves too ;) So let\u2019\
s get started now shall We?"
text: There's a place where time stands still. A place of breath taking wonder,
but also
---
<!-- markdownlint-disable MD041 -->
<!-- header start -->
<!-- 200823 -->
<div style="width: auto; margin-left: auto; margin-right: auto">
<img src="https://i.imgur.com/EBdldam.jpg" alt="TheBlokeAI" style="width: 100%; min-width: 400px; display: block; margin: auto;">
</div>
<div style="display: flex; justify-content: space-between; width: 100%;">
<div style="display: flex; flex-direction: column; align-items: flex-start;">
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://discord.gg/theblokeai">Chat & support: TheBloke's Discord server</a></p>
</div>
<div style="display: flex; flex-direction: column; align-items: flex-end;">
<p style="margin-top: 0.5em; margin-bottom: 0em;"><a href="https://www.patreon.com/TheBlokeAI">Want to contribute? TheBloke's Patreon page</a></p>
</div>
</div>
<div style="text-align:center; margin-top: 0em; margin-bottom: 0em"><p style="margin-top: 0.25em; margin-bottom: 0em;">TheBloke's LLM work is generously supported by a grant from <a href="https://a16z.com">andreessen horowitz (a16z)</a></p></div>
<hr style="margin-top: 1.0em; margin-bottom: 1.0em;">
<!-- header end -->
# Yi 34B Chat - GPTQ
- Model creator: [01-ai](https://huggingface.co/01-ai)
- Original model: [Yi 34B Chat](https://huggingface.co/01-ai/Yi-34B-Chat)
<!-- description start -->
# Description
This repo contains GPTQ model files for [01-ai's Yi 34B Chat](https://huggingface.co/01-ai/Yi-34B-Chat).
Multiple GPTQ parameter permutations are provided; see Provided Files below for details of the options provided, their parameters, and the software used to create them.
These files were quantised using hardware kindly provided by [Massed Compute](https://massedcompute.com/).
<!-- description end -->
<!-- repositories-available start -->
## Repositories available
* [AWQ model(s) for GPU inference.](https://huggingface.co/TheBloke/Yi-34B-Chat-AWQ)
* [GPTQ models for GPU inference, with multiple quantisation parameter options.](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ)
* [2, 3, 4, 5, 6 and 8-bit GGUF models for CPU+GPU inference](https://huggingface.co/TheBloke/Yi-34B-Chat-GGUF)
* [01-ai's original unquantised fp16 model in pytorch format, for GPU inference and for further conversions](https://huggingface.co/01-ai/Yi-34B-Chat)
<!-- repositories-available end -->
<!-- prompt-template start -->
## Prompt template: ChatML
```
<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
```
<!-- prompt-template end -->
<!-- README_GPTQ.md-compatible clients start -->
## Known compatible clients / servers
These GPTQ models are known to work in the following inference servers/webuis.
- [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
- [KoboldAI United](https://github.com/henk717/koboldai)
- [LoLLMS Web UI](https://github.com/ParisNeo/lollms-webui)
- [Hugging Face Text Generation Inference (TGI)](https://github.com/huggingface/text-generation-inference)
This may not be a complete list; if you know of others, please let me know!
<!-- README_GPTQ.md-compatible clients end -->
<!-- README_GPTQ.md-provided-files start -->
## Provided files, and GPTQ parameters
Multiple quantisation parameters are provided, to allow you to choose the best one for your hardware and requirements.
Each separate quant is in a different branch. See below for instructions on fetching from different branches.
Most GPTQ files are made with AutoGPTQ. Mistral models are currently made with Transformers.
<details>
<summary>Explanation of GPTQ parameters</summary>
- Bits: The bit size of the quantised model.
- GS: GPTQ group size. Higher numbers use less VRAM, but have lower quantisation accuracy. "None" is the lowest possible value.
- Act Order: True or False. Also known as `desc_act`. True results in better quantisation accuracy. Some GPTQ clients have had issues with models that use Act Order plus Group Size, but this is generally resolved now.
- Damp %: A GPTQ parameter that affects how samples are processed for quantisation. 0.01 is default, but 0.1 results in slightly better accuracy.
- GPTQ dataset: The calibration dataset used during quantisation. Using a dataset more appropriate to the model's training can improve quantisation accuracy. Note that the GPTQ calibration dataset is not the same as the dataset used to train the model - please refer to the original model repo for details of the training dataset(s).
- Sequence Length: The length of the dataset sequences used for quantisation. Ideally this is the same as the model sequence length. For some very long sequence models (16+K), a lower sequence length may have to be used. Note that a lower sequence length does not limit the sequence length of the quantised model. It only impacts the quantisation accuracy on longer inference sequences.
- ExLlama Compatibility: Whether this file can be loaded with ExLlama, which currently only supports Llama and Mistral models in 4-bit.
</details>
| Branch | Bits | GS | Act Order | Damp % | GPTQ Dataset | Seq Len | Size | ExLlama | Desc |
| ------ | ---- | -- | --------- | ------ | ------------ | ------- | ---- | ------- | ---- |
| [main](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/main) | 4 | None | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 18.60 GB | Yes | 4-bit, with Act Order. No group size, to lower VRAM requirements. |
| [gptq-4bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-4bit-128g-actorder_True) | 4 | 128 | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 19.25 GB | Yes | 4-bit, with Act Order and group size 128g. Uses even less VRAM than 64g, but with slightly lower accuracy. |
| [gptq-4bit-32g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-4bit-32g-actorder_True) | 4 | 32 | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 21.21 GB | Yes | 4-bit, with Act Order and group size 32g. Gives highest possible inference quality, with maximum VRAM usage. |
| [gptq-3bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-3bit-128g-actorder_True) | 3 | 128 | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 15.03 GB | No | 3-bit, with group size 128g and act-order. Higher quality than 128g-False. |
| [gptq-8bit--1g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-8bit--1g-actorder_True) | 8 | None | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 35.34 GB | No | 8-bit, with Act Order. No group size, to lower VRAM requirements. |
| [gptq-3bit-32g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-3bit-32g-actorder_True) | 3 | 32 | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 16.90 GB | No | 3-bit, with group size 64g and act-order. Highest quality 3-bit option. |
| [gptq-8bit-128g-actorder_True](https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ/tree/gptq-8bit-128g-actorder_True) | 8 | 128 | Yes | 0.1 | [VMWare Open Instruct](https://huggingface.co/datasets/VMware/open-instruct/viewer/) | 4096 | 36.11 GB | No | 8-bit, with group size 128g for higher inference quality and with Act Order for even higher accuracy. |
<!-- README_GPTQ.md-provided-files end -->
<!-- README_GPTQ.md-download-from-branches start -->
## How to download, including from branches
### In text-generation-webui
To download from the `main` branch, enter `TheBloke/Yi-34B-Chat-GPTQ` in the "Download model" box.
To download from another branch, add `:branchname` to the end of the download name, eg `TheBloke/Yi-34B-Chat-GPTQ:gptq-4bit-128g-actorder_True`
### From the command line
I recommend using the `huggingface-hub` Python library:
```shell
pip3 install huggingface-hub
```
To download the `main` branch to a folder called `Yi-34B-Chat-GPTQ`:
```shell
mkdir Yi-34B-Chat-GPTQ
huggingface-cli download TheBloke/Yi-34B-Chat-GPTQ --local-dir Yi-34B-Chat-GPTQ --local-dir-use-symlinks False
```
To download from a different branch, add the `--revision` parameter:
```shell
mkdir Yi-34B-Chat-GPTQ
huggingface-cli download TheBloke/Yi-34B-Chat-GPTQ --revision gptq-4bit-128g-actorder_True --local-dir Yi-34B-Chat-GPTQ --local-dir-use-symlinks False
```
<details>
<summary>More advanced huggingface-cli download usage</summary>
If you remove the `--local-dir-use-symlinks False` parameter, the files will instead be stored in the central Hugging Face cache directory (default location on Linux is: `~/.cache/huggingface`), and symlinks will be added to the specified `--local-dir`, pointing to their real location in the cache. This allows for interrupted downloads to be resumed, and allows you to quickly clone the repo to multiple places on disk without triggering a download again. The downside, and the reason why I don't list that as the default option, is that the files are then hidden away in a cache folder and it's harder to know where your disk space is being used, and to clear it up if/when you want to remove a download model.
The cache location can be changed with the `HF_HOME` environment variable, and/or the `--cache-dir` parameter to `huggingface-cli`.
For more documentation on downloading with `huggingface-cli`, please see: [HF -> Hub Python Library -> Download files -> Download from the CLI](https://huggingface.co/docs/huggingface_hub/guides/download#download-from-the-cli).
To accelerate downloads on fast connections (1Gbit/s or higher), install `hf_transfer`:
```shell
pip3 install hf_transfer
```
And set environment variable `HF_HUB_ENABLE_HF_TRANSFER` to `1`:
```shell
mkdir Yi-34B-Chat-GPTQ
HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli download TheBloke/Yi-34B-Chat-GPTQ --local-dir Yi-34B-Chat-GPTQ --local-dir-use-symlinks False
```
Windows Command Line users: You can set the environment variable by running `set HF_HUB_ENABLE_HF_TRANSFER=1` before the download command.
</details>
### With `git` (**not** recommended)
To clone a specific branch with `git`, use a command like this:
```shell
git clone --single-branch --branch gptq-4bit-128g-actorder_True https://huggingface.co/TheBloke/Yi-34B-Chat-GPTQ
```
Note that using Git with HF repos is strongly discouraged. It will be much slower than using `huggingface-hub`, and will use twice as much disk space as it has to store the model files twice (it stores every byte both in the intended target folder, and again in the `.git` folder as a blob.)
<!-- README_GPTQ.md-download-from-branches end -->
<!-- README_GPTQ.md-text-generation-webui start -->
## How to easily download and use this model in [text-generation-webui](https://github.com/oobabooga/text-generation-webui)
Please make sure you're using the latest version of [text-generation-webui](https://github.com/oobabooga/text-generation-webui).
It is strongly recommended to use the text-generation-webui one-click-installers unless you're sure you know how to make a manual install.
1. Click the **Model tab**.
2. Under **Download custom model or LoRA**, enter `TheBloke/Yi-34B-Chat-GPTQ`.
- To download from a specific branch, enter for example `TheBloke/Yi-34B-Chat-GPTQ:gptq-4bit-128g-actorder_True`
- see Provided Files above for the list of branches for each option.
3. Click **Download**.
4. The model will start downloading. Once it's finished it will say "Done".
5. In the top left, click the refresh icon next to **Model**.
6. In the **Model** dropdown, choose the model you just downloaded: `Yi-34B-Chat-GPTQ`
7. The model will automatically load, and is now ready for use!
8. If you want any custom settings, set them and then click **Save settings for this model** followed by **Reload the Model** in the top right.
- Note that you do not need to and should not set manual GPTQ parameters any more. These are set automatically from the file `quantize_config.json`.
9. Once you're ready, click the **Text Generation** tab and enter a prompt to get started!
<!-- README_GPTQ.md-text-generation-webui end -->
<!-- README_GPTQ.md-use-from-tgi start -->
## Serving this model from Text Generation Inference (TGI)
It's recommended to use TGI version 1.1.0 or later. The official Docker container is: `ghcr.io/huggingface/text-generation-inference:1.1.0`
Example Docker parameters:
```shell
--model-id TheBloke/Yi-34B-Chat-GPTQ --port 3000 --quantize gptq --max-input-length 3696 --max-total-tokens 4096 --max-batch-prefill-tokens 4096
```
Example Python code for interfacing with TGI (requires huggingface-hub 0.17.0 or later):
```shell
pip3 install huggingface-hub
```
```python
from huggingface_hub import InferenceClient
endpoint_url = "https://your-endpoint-url-here"
prompt = "Tell me about AI"
prompt_template=f'''<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'''
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}")
```
<!-- README_GPTQ.md-use-from-tgi end -->
<!-- README_GPTQ.md-use-from-python start -->
## Python code example: inference from this GPTQ model
### Install the necessary packages
Requires: Transformers 4.33.0 or later, Optimum 1.12.0 or later, and AutoGPTQ 0.4.2 or later.
```shell
pip3 install --upgrade transformers optimum
# If using PyTorch 2.1 + CUDA 12.x:
pip3 install --upgrade auto-gptq
# or, if using PyTorch 2.1 + CUDA 11.x:
pip3 install --upgrade auto-gptq --extra-index-url https://huggingface.github.io/autogptq-index/whl/cu118/
```
If you are using PyTorch 2.0, you will need to install AutoGPTQ from source. Likewise if you have problems with the pre-built wheels, you should try building from source:
```shell
pip3 uninstall -y auto-gptq
git clone https://github.com/PanQiWei/AutoGPTQ
cd AutoGPTQ
git checkout v0.5.1
pip3 install .
```
### Example Python code
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_name_or_path = "TheBloke/Yi-34B-Chat-GPTQ"
# To use a different branch, change revision
# For example: revision="gptq-4bit-128g-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'''<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
'''
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'])
```
<!-- README_GPTQ.md-use-from-python end -->
<!-- README_GPTQ.md-compatibility start -->
## Compatibility
The files provided are tested to work with Transformers. For non-Mistral models, AutoGPTQ can also be used directly.
[ExLlama](https://github.com/turboderp/exllama) is compatible with Llama and Mistral models in 4-bit. Please see the Provided Files table above for per-file compatibility.
For a list of clients/servers, please see "Known compatible clients / servers", above.
<!-- README_GPTQ.md-compatibility end -->
<!-- footer start -->
<!-- 200823 -->
## Discord
For further support, and discussions on these models and AI in general, join us at:
[TheBloke AI's Discord server](https://discord.gg/theblokeai)
## Thanks, and how to contribute
Thanks to the [chirper.ai](https://chirper.ai) team!
Thanks to Clay from [gpus.llm-utils.org](llm-utils)!
I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.
If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.
Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.
* Patreon: https://patreon.com/TheBlokeAI
* Ko-Fi: https://ko-fi.com/TheBlokeAI
**Special thanks to**: Aemon Algiz.
**Patreon special mentions**: 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
Thank you to all my generous patrons and donaters!
And thank you again to a16z for their generous grant.
<!-- footer end -->
# Original model card: 01-ai's Yi 34B Chat
<div align="center">
<p align="center">
<img width="200px" src="https://github.com/01-ai/Yi/raw/main/assets/img/Yi.svg?sanitize=true">
</p>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://github.com/01-ai/Yi/issues">
<img src="https://img.shields.io/github/issues/01-ai/Yi?logo=github" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://github.com/01-ai/Yi/actions/workflows/build_docker_image.yml">
<img src="https://github.com/01-ai/Yi/actions/workflows/build_docker_image.yml/badge.svg" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a href="https://huggingface.co/01-ai">
<img src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-01--ai-blue" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://www.modelscope.cn/organization/01ai/">
<img src="https://img.shields.io/badge/ModelScope-01--ai-blue" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://wisemodel.cn/organization/01.AI">
<img src="https://img.shields.io/badge/WiseModel-01--ai-blue" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://replicate.com/01-ai">
<img src="https://img.shields.io/badge/Replicate-01--ai-blue?logo=data:image/svg%2bxml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMTAwMCAxMDAwIiBjbGFzcz0ibG9nbyIgZmlsbD0iY3VycmVudENvbG9yIiB4bWw6c3BhY2U9InByZXNlcnZlIj4KICA8Zz4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCw0MjcuNiAxMDAwLDU0MC42IDYwMy40LDU0MC42IDYwMy40LDEwMDAgNDc3LDEwMDAgNDc3LDQyNy42IAkiPjwvcG9seWdvbj4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCwyMTMuOCAxMDAwLDMyNyAzNjQuOCwzMjcgMzY0LjgsMTAwMCAyMzguNCwxMDAwIDIzOC40LDIxMy44IAkiPjwvcG9seWdvbj4KICAgIDxwb2x5Z29uIHBvaW50cz0iMTAwMCwwIDEwMDAsMTEzLjIgMTI2LjQsMTEzLjIgMTI2LjQsMTAwMCAwLDEwMDAgMCwwIAkiPjwvcG9seWdvbj4KICA8L2c+Cjwvc3ZnPg==" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://github.com/01-ai/Yi/blob/main/LICENSE">
<img src="https://img.shields.io/badge/Code_License-Apache_2.0-lightblue" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt">
<img src="https://img.shields.io/badge/Model_License-Model_Agreement-lightblue" style="margin: 0 0;">
</a>
</div>
<div style="display: inline-block;">
<a rel="noopener nofollow" href="mailto:oss@01.ai">
<img src="https://img.shields.io/badge/✉️-yi@01.ai-FFE01B" style="margin: 0 0;">
</a>
</div>
</div>
## Introduction
The **Yi** series models are large language models trained from scratch by
developers at [01.AI](https://01.ai/).
## News
<details open>
<summary>🎯 <b>2023/11/23</b>: The chat models are open to public.</summary>
This release contains two chat models based on previous released base models, two 8-bits models quntinized by GPTQ, two 4-bits models quantinized by AWQ.
- `Yi-34B-Chat`
- `Yi-34B-Chat-4bits`
- `Yi-34B-Chat-8bits`
- `Yi-6B-Chat`
- `Yi-6B-Chat-4bits`
- `Yi-6B-Chat-8bits`
You can try some of them interactively at:
- [HuggingFace](https://huggingface.co/spaces/01-ai/Yi-34B-Chat)
- [Replicate](https://replicate.com/01-ai)
</details>
<details open>
<summary>🔔 <b>2023/11/23</b>: The Yi Series Models Community License Agreement is updated to v2.1.</summary>
</details>
<details>
<summary>🔥 <b>2023/11/08</b>: Invited test of Yi-34B chat model.</summary>
Application form:
- [English](https://cn.mikecrm.com/l91ODJf)
- [Chinese](https://cn.mikecrm.com/gnEZjiQ)
</details>
<details>
<summary>🎯 <b>2023/11/05</b>: The base model of <code>Yi-6B-200K</code> and <code>Yi-34B-200K</code>.</summary>
This release contains two base models with the same parameter sizes of previous
release, except that the context window is extended to 200K.
</details>
<details>
<summary>🎯 <b>2023/11/02</b>: The base model of <code>Yi-6B</code> and <code>Yi-34B</code>.</summary>
The first public release contains two bilingual (English/Chinese) base models
with the parameter sizes of 6B and 34B. Both of them are trained with 4K
sequence length and can be extended to 32K during inference time.
</details>
## Model Performance
### Base Model Performance
| Model | MMLU | CMMLU | C-Eval | GAOKAO | BBH | Common-sense Reasoning | Reading Comprehension | Math & Code |
| :------------ | :------: | :------: | :------: | :------: | :------: | :--------------------: | :-------------------: | :---------: |
| | 5-shot | 5-shot | 5-shot | 0-shot | 3-shot@1 | - | - | - |
| LLaMA2-34B | 62.6 | - | - | - | 44.1 | 69.9 | 68.0 | 26.0 |
| LLaMA2-70B | 68.9 | 53.3 | - | 49.8 | 51.2 | 71.9 | 69.4 | 36.8 |
| Baichuan2-13B | 59.2 | 62.0 | 58.1 | 54.3 | 48.8 | 64.3 | 62.4 | 23.0 |
| Qwen-14B | 66.3 | 71.0 | 72.1 | 62.5 | 53.4 | 73.3 | 72.5 | **39.8** |
| Skywork-13B | 62.1 | 61.8 | 60.6 | 68.1 | 41.7 | 72.4 | 61.4 | 24.9 |
| InternLM-20B | 62.1 | 59.0 | 58.8 | 45.5 | 52.5 | 78.3 | - | 30.4 |
| Aquila-34B | 67.8 | 71.4 | 63.1 | - | - | - | - | - |
| Falcon-180B | 70.4 | 58.0 | 57.8 | 59.0 | 54.0 | 77.3 | 68.8 | 34.0 |
| Yi-6B | 63.2 | 75.5 | 72.0 | 72.2 | 42.8 | 72.3 | 68.7 | 19.8 |
| Yi-6B-200K | 64.0 | 75.3 | 73.5 | 73.9 | 42.0 | 72.0 | 69.1 | 19.0 |
| **Yi-34B** | **76.3** | **83.7** | 81.4 | 82.8 | **54.3** | **80.1** | 76.4 | 37.1 |
| Yi-34B-200K | 76.1 | 83.6 | **81.9** | **83.4** | 52.7 | 79.7 | **76.6** | 36.3 |
While benchmarking open-source models, we have observed a disparity between the
results generated by our pipeline and those reported in public sources (e.g.
OpenCompass). Upon conducting a more in-depth investigation of this difference,
we have discovered that various models may employ different prompts,
post-processing strategies, and sampling techniques, potentially resulting in
significant variations in the outcomes. Our prompt and post-processing strategy
remains consistent with the original benchmark, and greedy decoding is employed
during evaluation without any post-processing for the generated content. For
scores that were not reported by the original authors (including scores reported
with different settings), we try to get results with our pipeline.
To evaluate the model's capability extensively, we adopted the methodology
outlined in Llama2. Specifically, we included PIQA, SIQA, HellaSwag, WinoGrande,
ARC, OBQA, and CSQA to assess common sense reasoning. SquAD, QuAC, and BoolQ
were incorporated to evaluate reading comprehension. CSQA was exclusively tested
using a 7-shot setup, while all other tests were conducted with a 0-shot
configuration. Additionally, we introduced GSM8K (8-shot@1), MATH (4-shot@1),
HumanEval (0-shot@1), and MBPP (3-shot@1) under the category "Math & Code". Due
to technical constraints, we did not test Falcon-180 on QuAC and OBQA; the score
is derived by averaging the scores on the remaining tasks. Since the scores for
these two tasks are generally lower than the average, we believe that
Falcon-180B's performance was not underestimated.
### Chat Model Performance
| Model | MMLU | MMLU | CMMLU | CMMLU | C-Eval(val)<sup>*</sup> | C-Eval(val)<sup>*</sup> | Truthful QA | BBH | BBH | GSM8k | GSM8k |
| ----------------------- | --------- | --------- | --------- | --------- | ----------------------- | ----------------------- | ----------- | --------- | --------- | --------- | --------- |
| | 0-shot | 5-shot | 0-shot | 5-shot | 0-shot | 5-shot | 0-shot | 0-shot | 3-shot | 0-shot | 4-shot |
| LLaMA2-13B-Chat | 50.88 | 47.33 | 27.47 | 35.08 | 27.93 | 35.88 | 36.84 | 32.90 | 58.22 | 36.85 | 2.73 |
| LLaMA2-70B-Chat | 59.42 | 59.86 | 36.10 | 40.99 | 34.99 | 41.31 | 53.95 | 42.36 | 58.53 | 47.08 | 58.68 |
| Baichuan2-13B-Chat | 55.09 | 50.14 | 58.64 | 59.47 | 56.02 | 54.75 | 48.98 | 38.81 | 47.15 | 45.72 | 23.28 |
| Qwen-14B-Chat | 63.99 | 64.98 | 67.73 | 70.57 | 66.12 | 70.06 | 52.49 | 49.65 | 54.98 | 59.51 | 61.18 |
| InternLM-Chat-20B | 55.55 | 57.42 | 53.55 | 53.75 | 51.19 | 53.57 | 51.75 | 42.41 | 36.68 | 15.69 | 43.44 |
| AquilaChat2-34B v1.2 | 65.15 | 66.70 | 67.51 | 70.02 | **82.99** | **89.38** | **64.33** | 20.12 | 34.28 | 11.52 | 48.45 |
| Yi-6B-Chat | 58.24 | 60.99 | 69.44 | 74.71 | 68.80 | 74.22 | 50.58 | 39.70 | 47.15 | 38.44 | 44.88 |
| Yi-6B-Chat-8bits(GPTQ) | 58.29 | 60.96 | 69.21 | 74.69 | 69.17 | 73.85 | 49.85 | 40.35 | 47.26 | 39.42 | 44.88 |
| Yi-6B-Chat-4bits(AWQ) | 56.78 | 59.89 | 67.70 | 73.29 | 67.53 | 72.29 | 50.29 | 37.74 | 43.62 | 35.71 | 38.36 |
| Yi-34B-Chat | **67.62** | 73.46 | **79.11** | **81.34** | 77.04 | 78.53 | 62.43 | 51.41 | **71.74** | **71.65** | **75.97** |
| Yi-34B-Chat-8bits(GPTQ) | 66.24 | **73.69** | 79.05 | 81.23 | 76.82 | 78.97 | 61.84 | **52.08** | 70.97 | 70.74 | 75.74 |
| Yi-34B-Chat-4bits(AWQ) | 65.77 | 72.42 | 78.21 | 80.50 | 75.71 | 77.27 | 61.84 | 48.30 | 69.39 | 70.51 | 74.00 |
We evaluated various benchmarks using both zero-shot and few-shot methods, except for TruthfulQA. Generally, the zero-shot approach is more common in chat models. Our evaluation strategy involves generating responses while following instructions explicitly or implicitly (such as using few-shot examples). We then isolate relevant answers from the generated text. Some models are not well-suited to produce output in the specific format required by instructions in few datasets, which leads to suboptimal results.
<strong>*</strong>: C-Eval results are evaluated on the validation datasets
### Quantized Chat Model Performance
We also provide both 4-bit (AWQ) and 8-bit (GPTQ) quantized Yi chat models. Evaluation results on various benchmarks have shown that the quantized models have negligible losses. Additionally, they reduce the memory footprint size. After testing different configurations of prompts and generation lengths, we highly recommend following the guidelines in the memory footprint table below when selecting a device to run our models.
| | batch=1 | batch=4 | batch=16 | batch=32 |
| ----------------------- | ------- | ------- | -------- | -------- |
| Yi-34B-Chat | 65GiB | 68GiB | 76GiB | >80GiB |
| Yi-34B-Chat-8bits(GPTQ) | 35GiB | 37GiB | 46GiB | 58GiB |
| Yi-34B-Chat-4bits(AWQ) | 19GiB | 20GiB | 30GiB | 40GiB |
| Yi-6B-Chat | 12GiB | 13GiB | 15GiB | 18GiB |
| Yi-6B-Chat-8bits(GPTQ) | 7GiB | 8GiB | 10GiB | 14GiB |
| Yi-6B-Chat-4bits(AWQ) | 4GiB | 5GiB | 7GiB | 10GiB |
Note: All the numbers in the table represent the minimum recommended memory for running models of the corresponding size.
### Limitations of Chat Model
The released chat model has undergone exclusive training using Supervised Fine-Tuning (SFT). Compared to other standard chat models, our model produces more diverse responses, making it suitable for various downstream tasks, such as creative scenarios. Furthermore, this diversity is expected to enhance the likelihood of generating higher quality responses, which will be advantageous for subsequent Reinforcement Learning (RL) training.
However, this higher diversity might amplify certain existing issues, including:
- **Hallucination**: This refers to the model generating factually incorrect or nonsensical information. With the model's responses being more varied, there's a higher chance of hallucination that are not based on accurate data or logical reasoning.
- **Non-determinism in re-generation**: When attempting to regenerate or sample responses, inconsistencies in the outcomes may occur. The increased diversity can lead to varying results even under similar input conditions.
- **Cumulative Error**: This occurs when errors in the model's responses compound over time. As the model generates more diverse responses, the likelihood of small inaccuracies building up into larger errors increases, especially in complex tasks like extended reasoning, mathematical problem-solving, etc.
To achieve more coherent and consistent responses, it is advisable to adjust generation configuration parameters such as`temperature`,`top_p`, or`top_k`. These adjustments can help in the balance between creativity and coherence in the model's outputs.
## Usage
Feel free to [create an issue](https://github.com/01-ai/Yi/issues/new) if you
encounter any problem when using the **Yi** series models.
### 1. Prepare development environment
#### 1.1 Docker
The best approach to try the **Yi** series models is through Docker with GPUs. We
provide the following docker images to help you get started.
- `registry.lingyiwanwu.com/ci/01-ai/yi:latest`
- `ghcr.io/01-ai/yi:latest`
Note that the `latest` tag always points to the latest code in the `main`
branch. To test a stable version, please replace it with a specific
[tag](https://github.com/01-ai/Yi/tags).
#### 1.2 Local development environment
We use [`conda-lock`](https://github.com/conda/conda-lock) to generate fully reproducible lock files for conda environments. You can refer to [conda-lock.yml](./conda-lock.yml) for the exact versions of the dependencies. Additionally, we utilize [`micromamba`](https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html) for installing these dependencies.
To install the dependencies, please follow these steps:
1. Install `micromamba` by following the instructions available [here](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html).
2. Execute `micromamba install -y -n yi -f conda-lock.yml` to create a conda environment named `yi` and install the necessary dependencies.
### 2. Download the model (optional)
By default, the model weights and tokenizer will be downloaded from
[HuggingFace](https://huggingface.co/01-ai) automatically in the next step. You
can also download them manually from the following places:
- [ModelScope](https://www.modelscope.cn/organization/01ai/)
- [WiseModel](https://wisemodel.cn/organization/01.AI)
### 3. Examples
#### 3.1 Use the chat model
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = '01-ai/Yi-34b-Chat'
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
# Since transformers 4.35.0, the GPT-Q/AWQ model can be loaded using AutoModelForCausalLM.
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
# Prompt content: "hi"
messages = [
{"role": "user", "content": "hi"}
]
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
output_ids = model.generate(input_ids.to('cuda'))
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
# Model response: "Hello! How can I assist you today?"
print(response)
```
#### 3.2 Use the base model
```bash
python demo/text_generation.py
```
To reuse the downloaded models in the previous step, you can provide the extra
`--model` argument:
```bash
python demo/text_generation.py --model /path/to/model
```
Or if you'd like to get your hands dirty:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-34B", device_map="auto", torch_dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-34B", trust_remote_code=True)
inputs = tokenizer("There's a place where time stands still. A place of breath taking wonder, but also", return_tensors="pt")
max_length = 256
outputs = model.generate(
inputs.input_ids.cuda(),
max_length=max_length,
eos_token_id=tokenizer.eos_token_id,
do_sample=True,
repetition_penalty=1.3,
no_repeat_ngram_size=5,
temperature=0.7,
top_k=40,
top_p=0.8,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
```
<details>
<summary>Output</summary>
**Prompt**: There's a place where time stands still. A place of breath taking wonder, but also
**Generation**: There's a place where time stands still. A place of breath taking wonder, but also of great danger. A place where the very air you breathe could kill you. A place where the only way to survive is to be prepared.
The place is called the Arctic.
The Arctic is a vast, frozen wilderness. It is a place of extremes. The temperatures can drop to -40 degrees Celsius. The winds can reach speeds of 100 kilometers per hour. The sun can shine for 24 hours a day, or not at all for weeks on end.
The Arctic is also a place of great beauty. The ice and snow are a pristine white. The sky is a deep blue. The sunsets are spectacular.
But the Arctic is also a place of great danger. The ice can be treacherous. The winds can be deadly. The sun can be blinding.
The Arctic is a place where the only way to survive is to be prepared.
The Arctic is a place of extremes. The temperatures can drop to -40 degrees Celsius. The winds can reach speeds of 100 kilometers per hour. The sun can shine for 24 hours a day, or not at all for weeks on end.
The Arctic is a place of great beauty. The ice and snow are a
</details>
For more advanced usage, please refer to the
[doc](https://github.com/01-ai/Yi/tree/main/demo).
#### 3.3 Finetuning from the base model:
```bash
bash finetune/scripts/run_sft_Yi_6b.sh
```
Once finished, you can compare the finetuned model and the base model with the following command:
```bash
bash finetune/scripts/run_eval.sh
```
For more advanced usage like fine-tuning based on your custom data, please refer
the [doc](https://github.com/01-ai/Yi/tree/main/finetune).
#### 3.4 Quantization
##### GPT-Q
```bash
python quantization/gptq/quant_autogptq.py \
--model /base_model \
--output_dir /quantized_model \
--trust_remote_code
```
Once finished, you can then evaluate the resulting model as follows:
```bash
python quantization/gptq/eval_quantized_model.py \
--model /quantized_model \
--trust_remote_code
```
For a more detailed explanation, please read the [doc](https://github.com/01-ai/Yi/tree/main/quantization/gptq)
##### AWQ
```bash
python quantization/awq/quant_autoawq.py \
--model /base_model \
--output_dir /quantized_model \
--trust_remote_code
```
Once finished, you can then evaluate the resulted model as follows:
```bash
python quantization/awq/eval_quantized_model.py \
--model /quantized_model \
--trust_remote_code
```
For more detailed explanation, please read the [doc](https://github.com/01-ai/Yi/tree/main/quantization/awq)
## Ecosystem
🤗 You are encouraged to create a PR and share your awesome work built on top of
the Yi series models.
- Serving
- [ScaleLLM](https://github.com/vectorch-ai/ScaleLLM#supported-models): Efficiently run Yi models locally.
- Quantization
- [TheBloke/Yi-34B-GGUF](https://huggingface.co/TheBloke/Yi-34B-GGUF)
- [TheBloke/Yi-34B-GPTQ](https://huggingface.co/TheBloke/Yi-34B-GPTQ)
- Finetuning
- [NousResearch/Nous-Capybara-34B](https://huggingface.co/NousResearch/Nous-Capybara-34B)
## FAQ
1. **What dataset was this trained with?**
The dataset we use contains Chinese & English only. We used approximately 3T
tokens. The detailed number and its construction will be described in the
upcoming technical report.
## Disclaimer
We use data compliance checking algorithms during the training process, to
ensure the compliance of the trained model to the best of our ability. Due to
complex data and the diversity of language model usage scenarios, we cannot
guarantee that the model will generate correct, and reasonable output in all
scenarios. Please be aware that there is still a risk of the model producing
problematic outputs. We will not be responsible for any risks and issues
resulting from misuse, misguidance, illegal usage, and related misinformation,
as well as any associated data security concerns.
## License
The source code in this repo is licensed under the [Apache 2.0
license](https://github.com/01-ai/Yi/blob/main/LICENSE). The Yi series models
are fully open for academic research and free commercial usage with permission
via applications. All usage must adhere to the [Model License
Agreement 2.0](https://github.com/01-ai/Yi/blob/main/MODEL_LICENSE_AGREEMENT.txt).
To apply for the official commercial license, please contact us
([yi@01.ai](mailto:yi@01.ai)).

39
config.json Normal file
View File

@@ -0,0 +1,39 @@
{
"_name_or_path": "/workspace/process/01-ai_yi-34b-chat/source",
"architectures": [
"LlamaForCausalLM"
],
"attention_bias": false,
"bos_token_id": 1,
"eos_token_id": 2,
"hidden_act": "silu",
"hidden_size": 7168,
"initializer_range": 0.02,
"intermediate_size": 20480,
"max_position_embeddings": 4096,
"model_type": "llama",
"num_attention_heads": 56,
"num_hidden_layers": 60,
"num_key_value_heads": 8,
"pad_token_id": 0,
"pretraining_tp": 1,
"rms_norm_eps": 1e-05,
"rope_scaling": null,
"rope_theta": 5000000.0,
"tie_word_embeddings": false,
"torch_dtype": "bfloat16",
"transformers_version": "4.35.2",
"use_cache": true,
"vocab_size": 64000,
"quantization_config": {
"bits": 4,
"group_size": -1,
"damp_percent": 0.1,
"desc_act": true,
"sym": true,
"true_sequential": true,
"model_name_or_path": null,
"model_file_base_name": "model",
"quant_method": "gptq"
}
}

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}

10
generation_config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"bos_token_id": 6,
"do_sample": true,
"eos_token_id": 7,
"pad_token_id": 0,
"temperature": 0.6,
"max_length": 4096,
"top_p": 0.8,
"transformers_version": "4.35.0"
}

3
model.safetensors Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:27188b75394d8f5570a73935a56ac1d4287df24c0dec201a7989dcd4ead149b6
size 18604922424

10
quantize_config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"bits": 4,
"group_size": -1,
"damp_percent": 0.1,
"desc_act": true,
"sym": true,
"true_sequential": true,
"model_name_or_path": null,
"model_file_base_name": "model"
}

35
special_tokens_map.json Normal file
View File

@@ -0,0 +1,35 @@
{
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|im_sep|>"
],
"bos_token": {
"content": "<|startoftext|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"eos_token": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"pad_token": {
"content": "<unk>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
},
"unk_token": {
"content": "<unk>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false
}
}

3
tokenizer.model Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:386c49cf943d71aa110361135338c50e38beeff0a66593480421f37b319e1a39
size 1033105

72
tokenizer_config.json Normal file
View File

@@ -0,0 +1,72 @@
{
"add_bos_token": false,
"add_eos_token": false,
"added_tokens_decoder": {
"0": {
"content": "<unk>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
},
"1": {
"content": "<|startoftext|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
},
"2": {
"content": "<|endoftext|>",
"lstrip": false,
"normalized": true,
"rstrip": false,
"single_word": false,
"special": true
},
"6": {
"content": "<|im_start|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"7": {
"content": "<|im_end|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
},
"8": {
"content": "<|im_sep|>",
"lstrip": false,
"normalized": false,
"rstrip": false,
"single_word": false,
"special": true
}
},
"additional_special_tokens": [
"<|im_start|>",
"<|im_end|>",
"<|im_sep|>"
],
"bos_token": "<|startoftext|>",
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
"clean_up_tokenization_spaces": false,
"eos_token": "<|endoftext|>",
"legacy": true,
"model_max_length": 4096,
"pad_token": "<unk>",
"padding_side": "right",
"sp_model_kwargs": {},
"spaces_between_special_tokens": false,
"tokenizer_class": "LlamaTokenizer",
"unk_token": "<unk>",
"use_default_system_prompt": true
}