🤗 Hugging Face • 🤖 ModelScope • ✡️ WiseModel
👩🚀 在 GitHub 上提问或交流想法
📝 查阅 Yi 技术报告
📚 在 Yi 学习中心 共同成长
🤖 Yi 系列模型是由 01.AI 从头开始训练的下一代开源大型语言模型。
🙌 作为一款双语语言模型,Yi 系列模型在 3T 多语言语料上进行训练,已跻身全球最强 LLM 行列,在语言理解、常识推理、阅读理解等方面展现出巨大潜力。例如:
Yi-34B-Chat 模型在 AlpacaEval 排行榜上位列第二(仅次于 GPT-4 Turbo),性能超过其他 LLM(如 GPT-4、Mixtral、Claude)(基于 2024 年 1 月的可用数据)。
Yi-34B 模型在多个基准测试中,包括 Hugging Face Open LLM Leaderboard(预训练)和 C-Eval,在所有现有开源模型(如 Falcon-180B、Llama-70B、Claude)中, 在英文和中文方面均排名第一(基于 2023 年 11 月的可用数据)。
🙏(致谢 Llama)感谢 Transformer 和 Llama 开源社区,他们减少了从头构建模型的工作量,并使得在 AI 生态系统中能够使用相同的工具。
💡 核心要点
Yi 系列模型采用与 Llama 相同的模型架构,但并非 Llama 的衍生产品。
Yi 和 Llama 均基于 Transformer 结构,自 2018 年以来,Transformer 一直是大型语言模型的标准架构。
基于 Transformer 架构,Llama 凭借其出色的稳定性、可靠的收敛性和强大的兼容性,已成为大多数最先进开源模型的新基石。这使得 Llama 成为包括 Yi 在内的众多模型公认的基础框架。
得益于 Transformer 和 Llama 架构,其他模型能够借助它们的优势,减少从头构建的工作量,并能够在其生态系统中使用相同的工具。
然而,Yi 系列模型并非 Llama 的衍生产品,因为它们不使用 Llama 的权重。
由于 Llama 的结构被大多数开源模型所采用,决定模型性能的关键因素是训练数据集、训练管道和训练基础设施。
Yi 以独特且专有的方式开发,完全从头开始独立创建了自己的高质量训练数据集、高效的训练管道和强大的训练基础设施。这一努力使得 Yi 系列模型取得了优异的性能,在 2023 年 12 月的 Alpaca 排行榜 上仅次于 GPT4,并超越了 Llama。
[ 返回顶部 ⬆️ ]
Yi-9B-200K模型开源并向公众开放。Yi-9B模型开源并向公众开放。Yi-9B在众多同规模开源模型(包括Mistral-7B、SOLAR-10.7B、Gemma-7B、DeepSeek-Coder-7B-Base-v1.5等)中表现卓越,尤其在代码生成、数学能力、常识推理和阅读理解方面优势突出。
Yi-VL-34B与Yi-VL-6B开源并向公众开放。Yi-VL-34B在最新基准测试中(包括MMMU和CMMMU),在所有现有开源模型中排名第一(基于2024年1月可获取数据)。
Yi-34B-ChatYi-34B-Chat-4bitsYi-34B-Chat-8bitsYi-6B-ChatYi-6B-Chat-4bitsYi-6B-Chat-8bits您可以通过以下平台交互式体验部分模型:
Yi-6B-200K和Yi-34B-200K开源并向公众开放。Yi-6B和Yi-34B开源并向公众开放。[ 返回顶部 ⬆️ ]
Yi 模型提供多种尺寸,可满足不同的使用场景。您也可以对 Yi 模型进行微调,以满足特定需求。
如果您想部署 Yi 模型,请确保满足软硬件要求。
| 模型 | 下载地址 |
|---|---|
| Yi-34B-Chat | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-34B-Chat-4bits | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-34B-Chat-8bits | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-6B-Chat | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-6B-Chat-4bits | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-6B-Chat-8bits | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
- 4-bit 系列模型通过 AWQ 进行量化。
- 8-bit 系列模型通过 GPTQ 进行量化。
- 所有量化模型使用门槛低,可部署在消费级 GPU 上(如 3090、4090)。
| 模型 | 下载地址 |
|---|---|
| Yi-34B | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-34B-200K | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-9B | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-9B-200K | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-6B | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
| Yi-6B-200K | • 🤗 Hugging Face • 🤖 ModelScope • 🟣 wisemodel |
- 200K 大约相当于 40 万个汉字。
- 若需使用 Yi-34B-200K 的旧版本(2023 年 11 月 5 日发布),请运行 git checkout 069cd341d60f4ce4b07ec394e82b79e94f656cf 下载权重。
| 模型 | 介绍 | 默认上下文窗口 | 预训练 tokens | 训练数据日期 |
|---|---|---|---|---|
| 6B 系列模型 | 适用于个人和学术用途。 | 4K | 3T | 截至 2023 年 6 月 |
| 9B 系列模型 | 是 Yi 系列模型中在代码和数学方面表现最佳的。 | Yi-9B 在 Yi-6B 的基础上持续训练,使用了 0.8T tokens。 | ||
| 34B 系列模型 | 适用于个人、学术以及商业用途(尤其适合中小型企业)。这是一种经济实惠的解决方案,价格亲民且具备涌现能力。 | 3T |
针对聊天模型
然而,这种更高的多样性可能会放大某些现有问题,包括:
[ 返回顶部 ⬆️ ]
💡 提示:如果您想开始使用 Yi 模型并探索不同的推理方法,请查看 Yi 实践指南。
选择以下任一方式开始您的 Yi 使用之旅!

如果您希望在本地部署 Yi 模型,
🙋♀️ 且您的资源有限(例如,MacBook Pro),您可以使用 llama.cpp。
如果您不希望在本地部署 Yi 模型,您可以通过以下任一选项探索 Yi 的功能。
如果您想探索 Yi 的更多功能,您可以采用以下任一方法:
如果您想与 Yi 聊天并使用更多自定义选项(如系统提示、温度参数、重复惩罚等),您可以尝试以下任一选项:
Yi-34B-Chat-Playground(Replicate)
如果您想与 Yi 聊天,您可以使用以下任一在线服务,它们提供类似的用户体验:
Yi-34B-Chat(Hugging Face 上的 Yi 官方空间)
Yi-34B-Chat(Yi 官方测试版)
[ 返回顶部 ⬆️ ]
本教程将引导您完成在 A800(80G)本地运行 Yi-34B-Chat 并进行推理的每一步操作。
确保已安装 Python 3.10 或更高版本。
如需运行其他 Yi 模型,请参见软硬件要求。
执行以下命令以设置环境并安装所需软件包。
git clone https://github.com/01-ai/Yi.git
cd yi
pip install -r requirements.txt您可以从以下来源下载 Yi 模型的权重和分词器:
您可以按以下方式使用 Yi 对话模型或基础模型进行推理。
创建一个名为 quick_start.py 的文件,并将以下内容复制到其中。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = '<your-model-path>'
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
# 自 transformers 4.35.0 起,GPT-Q/AWQ 模型可通过 AutoModelForCausalLM 加载。
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
# 提示内容:"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)
# 模型响应:"Hello! How can I assist you today?"
print(response)运行 quick_start.py。
python quick_start.py然后您将看到类似以下的输出。🥳
Hello! How can I assist you today?Yi-34B
步骤与 pip - 使用 Yi 对话模型进行推理 类似。
您可以使用现有的文件 text_generation.py。
python demo/text_generation.py --model <your-model-path>然后您将看到类似以下的输出。🥳
提示:Let me tell you an interesting story about cat Tom and mouse Jerry,
生成内容:Let me tell you an interesting story about cat Tom and mouse Jerry, which happened in my childhood. My father had a big house with two cats living inside it to kill mice. One day when I was playing at home alone, I found one of the tomcats lying on his back near our kitchen door, looking very much like he wanted something from us but couldn’t get up because there were too many people around him! He kept trying for several minutes before finally giving up...
Yi-9B
输入
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_DIR = "01-ai/Yi-9B"
model = AutoModelForCausalLM.from_pretrained(MODEL_DIR, torch_dtype="auto")
tokenizer = AutoTokenizer.from_pretrained(MODEL_DIR, use_fast=False)
input_text = "# write the quick sort algorithm"
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_length=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))输出
# write the quick sort algorithm
def quick_sort(arr):
if len(arr) <= 1:
return arr
pivot = arr[len(arr) // 2]
left = [x for x in arr if x < pivot]
middle = [x for x in arr if x == pivot]
right = [x for x in arr if x > pivot]
return quick_sort(left) + middle + quick_sort(right)
# test the quick sort algorithm
print(quick_sort([3, 6, 8, 10, 1, 2, 1]))[ 返回顶部 ⬆️ ]
确保您已安装 Docker 和 nvidia-container-toolkit。
docker run -it --gpus all \
-v <your-model-path>: /models
ghcr.io/01-ai/yi:latest或者,您可以从 registry.lingyiwanwu.com/ci/01-ai/yi:latest 拉取 Yi Docker 镜像。
您可以按以下方式使用 Yi 对话模型或基础模型进行推理。
步骤与 pip - 使用 Yi 对话模型执行推理 类似。
注意,唯一的区别是设置 model_path = '<your-model-mount-path>',而不是 model_path = '<your-model-path>'。
步骤与 pip - 使用 Yi 基础模型执行推理 类似。
注意,唯一的区别是设置 --model <your-model-mount-path>',而不是 model <your-model-path>。
conda-lock 为 conda 环境生成完全可重现的锁定文件。⬇️micromamba 来安装这些依赖项。
按照 此处 的说明安装 micromamba。
执行 micromamba install -y -n yi -f conda-lock.yml 以创建名为 yi 的 conda 环境并安装必要的依赖项。
以下教程将引导您完成在本地运行量化模型(Yi-chat-6B-2bits)并进行推理的每一步。
本教程假设您使用的是配备16GB内存和Apple M2 Pro芯片的MacBook Pro。
确保您的机器上已安装git-lfs。
llama.cpp要克隆llama.cpp代码库,请运行以下命令。
git clone git@github.com:ggerganov/llama.cpp.git2.1 若要仅通过指针克隆 XeIaso/yi-chat-6B-GGUF,请运行以下命令。
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/XeIaso/yi-chat-6B-GGUF2.2 如需下载量化后的 Yi 模型(yi-chat-6b.Q2_K.gguf),请运行以下命令。
git-lfs pull --include yi-chat-6b.Q2_K.gguf若要使用 Yi 模型执行推理,您可以采用以下方法之一。
若要使用 4 个线程编译 llama.cpp 并进行推理,请导航至 llama.cpp 目录,然后运行以下命令。
提示
将
/Users/yu/yi-chat-6B-GGUF/yi-chat-6b.Q2_K.gguf替换为您模型的实际路径。默认情况下,模型以补全模式运行。
如需其他输出自定义选项(例如,系统提示词、温度值、重复惩罚等),请运行
./main -h查看详细说明和用法。
make -j4 && ./main -m /Users/yu/yi-chat-6B-GGUF/yi-chat-6b.Q2_K.gguf -p "How do you feed your pet fox? Please answer this question in 6 simple steps:\nStep 1:" -n 384 -e
...
How do you feed your pet fox? Please answer this question in 6 simple steps:
Step 1: Select the appropriate food for your pet fox. You should choose high-quality, balanced prey items that are suitable for their unique dietary needs. These could include live or frozen mice, rats, pigeons, or other small mammals, as well as fresh fruits and vegetables.
Step 2: Feed your pet fox once or twice a day, depending on the species and its individual preferences. Always ensure that they have access to fresh water throughout the day.
Step 3: Provide an appropriate environment for your pet fox. Ensure it has a comfortable place to rest, plenty of space to move around, and opportunities to play and exercise.
Step 4: Socialize your pet with other animals if possible. Interactions with other creatures can help them develop social skills and prevent boredom or stress.
Step 5: Regularly check for signs of illness or discomfort in your fox. Be prepared to provide veterinary care as needed, especially for common issues such as parasites, dental health problems, or infections.
Step 6: Educate yourself about the needs of your pet fox and be aware of any potential risks or concerns that could affect their well-being. Regularly consult with a veterinarian to ensure you are providing the best care.
...
现在您已成功向 Yi 模型提问并获得了答案!🥳
若要初始化一个轻量级且响应迅速的聊天机器人,请运行以下命令。
cd llama.cpp
./server --ctx-size 2048 --host 0.0.0.0 --n-gpu-layers 64 --model /Users/yu/yi-chat-6B-GGUF/yi-chat-6b.Q2_K.gguf随后,您将看到类似以下的输出:
...
llama_new_context_with_model: n_ctx = 2048
llama_new_context_with_model: freq_base = 5000000.0
llama_new_context_with_model: freq_scale = 1
ggml_metal_init: allocating
ggml_metal_init: found device: Apple M2 Pro
ggml_metal_init: picking default device: Apple M2 Pro
ggml_metal_init: ggml.metallib not found, loading from source
ggml_metal_init: GGML_METAL_PATH_RESOURCES = nil
ggml_metal_init: loading '/Users/yu/llama.cpp/ggml-metal.metal'
ggml_metal_init: GPU name: Apple M2 Pro
ggml_metal_init: GPU family: MTLGPUFamilyApple8 (1008)
ggml_metal_init: hasUnifiedMemory = true
ggml_metal_init: recommendedMaxWorkingSetSize = 11453.25 MB
ggml_metal_init: maxTransferRate = built-in GPU
ggml_backend_metal_buffer_type_alloc_buffer: allocated buffer, size = 128.00 MiB, ( 2629.44 / 10922.67)
llama_new_context_with_model: KV self size = 128.00 MiB, K (f16): 64.00 MiB, V (f16): 64.00 MiB
ggml_backend_metal_buffer_type_alloc_buffer: allocated buffer, size = 0.02 MiB, ( 2629.45 / 10922.67)
llama_build_graph: non-view tensors processed: 676/676
llama_new_context_with_model: compute buffer total size = 159.19 MiB
ggml_backend_metal_buffer_type_alloc_buffer: allocated buffer, size = 156.02 MiB, ( 2785.45 / 10922.67)
Available slots:
-> Slot 0 - max context: 2048
llama server listening at http://0.0.0.0:8080要访问聊天机器人界面,请打开您的网页浏览器,并在地址栏中输入 http://0.0.0.0:8080。

在提示窗口中输入问题,例如“如何喂养你的宠物狐狸?请用 6 个简单步骤回答”,您将收到相应的答案。

[ 返回顶部 ⬆️ ]
您可以为 Yi 对话模型搭建 Web UI 演示(请注意,Yi 基础模型在此场景下暂不支持)。
步骤 3:要在本地启动 Web 服务,请运行以下命令。
python demo/web_demo.py -c <your-model-path>您可以通过在浏览器中输入控制台提供的地址来访问网页用户界面。

[ 返回顶部 ⬆️ ]
bash finetune/scripts/run_sft_Yi_6b.sh完成后,您可以使用以下命令比较微调模型和基础模型:
bash finetune/scripts/run_eval.sh默认情况下,我们使用来自 BAAI/COIG 的小型数据集对基础模型进行微调。
您也可以按照以下 jsonl 格式准备自定义数据集:
{ "prompt": "Human: Who are you? Assistant:", "chosen": "I'm Yi." }然后将它们挂载到容器中以替换默认文件:
docker run -it \
-v /path/to/save/finetuned/model/:/finetuned-model \
-v /path/to/train.jsonl:/yi/finetune/data/train.json \
-v /path/to/eval.jsonl:/yi/finetune/data/eval.json \
ghcr.io/01-ai/yi:latest \
bash finetune/scripts/run_sft_Yi_6b.sh请确保您已安装 conda。如果尚未安装,请使用
mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm -rf ~/miniconda3/miniconda.sh
~/miniconda3/bin/conda init bash
source ~/.bashrc然后,创建一个 conda 环境:
conda create -n dev_env python=3.10 -y
conda activate dev_env
pip install torch==2.0.1 deepspeed==0.10 tensorboard transformers datasets sentencepiece accelerate ray==2.7对于 Yi-6B 模型,建议使用配备 4 块 GPU 的节点,每块 GPU 显存需大于 60GB。
对于 Yi-34B 模型,由于 zero-offload 技术的使用会消耗大量 CPU 内存,因此在进行 34B 模型的微调训练时,请务必注意限制 GPU 的数量。请使用 CUDA_VISIBLE_DEVICES 来限制 GPU 数量(如 scripts/run_sft_Yi_34b.sh 所示)。
微调 34B 模型的典型硬件配置为:一个节点配备 8 块 GPU(运行时通过 CUDA_VISIBLE_DEVICES=0,1,2,3 限制为 4 块使用),每块 GPU 显存大于 80GB,且总 CPU 内存大于 900GB。
将 LLM 基础模型下载至 MODEL_PATH(6B 和 34B)。模型的典型文件夹结构如下:
|-- $MODEL_PATH
| |-- config.json
| |-- pytorch_model-00001-of-00002.bin
| |-- pytorch_model-00002-of-00002.bin
| |-- pytorch_model.bin.index.json
| |-- tokenizer_config.json
| |-- tokenizer.model
| |-- ...从 huggingface 将数据集下载到本地存储路径 DATA_PATH,例如 Dahoas/rm-static。
|-- $DATA_PATH
| |-- data
| | |-- train-00000-of-00001-2a1df75c6bce91ab.parquet
| | |-- test-00000-of-00001-8c7c51afc6d45980.parquet
| |-- dataset_infos.json
| |-- README.mdfinetune/yi_example_dataset 包含示例数据集,这些数据集是基于 BAAI/COIG 修改而成。
|-- $DATA_PATH
|--data
|-- train.jsonl
|-- eval.jsonlcd 进入 scripts 文件夹,复制粘贴脚本并运行。例如:
cd finetune/scripts
bash run_sft_Yi_6b.sh对于 Yi-6B 基础模型,设置 training_debug_steps=20 且 num_train_epochs=4 即可输出一个对话模型,耗时约 20 分钟。
对于 Yi-34B 基础模型,其初始化过程耗时较长,请耐心等待。
cd finetune/scripts
bash run_eval.sh然后你将看到基础模型和微调模型的答案。
[ 返回顶部 ⬆️ ]
python quantization/gptq/quant_autogptq.py \
--model /base_model \
--output_dir /quantized_model \
--trust_remote_code完成后,你可以按以下方式评估生成的模型:
python quantization/gptq/eval_quantized_model.py \
--model /quantized_model \
--trust_remote_codepython quant_autogptq.py --model /base_model \
--output_dir /quantized_model --bits 4 --group_size 128 --trust_remote_code您可以使用 eval_quantized_model.py 运行量化模型:
python eval_quantized_model.py --model /quantized_model --trust_remote_codepython quantization/awq/quant_autoawq.py \
--model /base_model \
--output_dir /quantized_model \
--trust_remote_code完成后,你可以按以下方式评估生成的模型:
python quantization/awq/eval_quantized_model.py \
--model /quantized_model \
--trust_remote_codepython quant_autoawq.py --model /base_model \
--output_dir /quantized_model --bits 4 --group_size 128 --trust_remote_code您可以使用 eval_quantized_model.py 运行量化模型:
python eval_quantized_model.py --model /quantized_model --trust_remote_code[ 返回顶部 ⬆️ ]
若要部署Yi模型,请确保满足以下软件和硬件要求。
使用Yi量化模型前,请确保已安装以下正确软件。
| 模型 | 软件 |
|---|---|
| Yi 4位量化模型 | AWQ 和 CUDA |
| Yi 8位量化模型 | GPTQ 和 CUDA |
在环境中部署Yi模型前,请确保硬件满足以下要求。
| 模型 | 最低显存 | 推荐GPU示例 |
|---|---|---|
| Yi-6B-Chat | 15 GB | 1 x RTX 3090 (24 GB) 1 x RTX 4090 (24 GB) 1 x A10 (24 GB) 1 x A30 (24 GB) |
| Yi-6B-Chat-4bits | 4 GB | 1 x RTX 3060 (12 GB) 1 x RTX 4060 (8 GB) |
| Yi-6B-Chat-8bits | 8 GB | 1 x RTX 3070 (8 GB) 1 x RTX 4060 (8 GB) |
| Yi-34B-Chat | 72 GB | 4 x RTX 4090 (24 GB) 1 x A800 (80GB) |
| Yi-34B-Chat-4bits | 20 GB | 1 x RTX 3090 (24 GB) 1 x RTX 4090 (24 GB) 1 x A10 (24 GB) 1 x A30 (24 GB) 1 x A100 (40 GB) |
| Yi-34B-Chat-8bits | 38 GB | 2 x RTX 3090 (24 GB) 2 x RTX 4090 (24 GB) 1 x A800 (40 GB) |
以下是不同批量使用场景下的详细最低显存要求。
| 模型 | batch=1 | batch=4 | batch=16 | batch=32 |
|---|---|---|---|---|
| Yi-6B-Chat | 12 GB | 13 GB | 15 GB | 18 GB |
| Yi-6B-Chat-4bits | 4 GB | 5 GB | 7 GB | 10 GB |
| Yi-6B-Chat-8bits | 7 GB | 8 GB | 10 GB | 14 GB |
| Yi-34B-Chat | 65 GB | 68 GB | 76 GB | > 80 GB |
| Yi-34B-Chat-4bits | 19 GB | 20 GB | 30 GB | 40 GB |
| Yi-34B-Chat-8bits | 35 GB | 37 GB | 46 GB | 58 GB |
| 模型 | 最低显存 | 推荐GPU示例 |
|---|---|---|
| Yi-6B | 15 GB | 1 x RTX 3090 (24 GB) 1 x RTX 4090 (24 GB) 1 x A10 (24 GB) 1 x A30 (24 GB) |
| Yi-6B-200K | 50 GB | 1 x A800 (80 GB) |
| Yi-9B | 20 GB | 1 x RTX 4090 (24 GB) |
| Yi-34B | 72 GB | 4 x RTX 4090 (24 GB) 1 x A800 (80 GB) |
| Yi-34B-200K | 200 GB | 4 x A800 (80 GB) |
[ 返回顶部 ⬆️ ]
Yi-34B 和 Yi-34B-Chat 上进行全量微调的主要区别在于微调方法和结果。
Yi-34B 可能是您的首选。Yi-34B-Chat 或许是您的最佳选择。从哪里可以获取微调问答数据集?
微调 Yi-34B FP16 需要多少 GPU 内存?
微调 34B FP16 所需的 GPU 内存取决于所采用的具体微调方法。对于全参数微调,您需要 8 块各 80 GB 显存的 GPU;不过,像 Lora 这样更经济的方案则需求较低。更多详情,请查看 hiyouga/LLaMA-Factory。另外,考虑使用 BF16 而非 FP16 进行微调以优化性能。
是否有第三方平台支持 Yi-34b-200k 模型的对话功能?
如果您正在寻找第三方对话平台,可选方案包括 fireworks.ai。
欢迎来到 Yi 学习中心!
无论您是经验丰富的开发者,还是刚入门的新手,都能在这里找到丰富的学习资源,帮助您深入理解 Yi 模型并提升相关技能,包括富有洞见的博客文章、全面的视频教程、实用的操作指南等。
这里的内容由知识渊博的 Yi 专家和热情的爱好者们慷慨贡献。我们衷心感谢大家的宝贵付出!
同时,我们也热烈邀请您加入 Yi 的贡献者行列。如果您已经为 Yi 做出了贡献,欢迎在下方表格中展示您的杰出成果。
有了这些资源,您已准备好开启精彩的 Yi 探索之旅。祝您学习愉快!🥳
| 成果 | 日期 | 作者 |
|---|---|---|
| yi-openai-proxy | 2024-05-11 | 苏洋 |
| 基于零一万物 Yi 模型和 B 站构建大语言模型高质量训练数据集 | 2024-04-29 | 正经人王同学 |
| 基于视频网站和零一万物大模型构建大语言模型高质量训练数据集 | 2024-04-25 | 正经人王同学 |
| 基于零一万物yi-34b-chat-200k输入任意文章地址,点击按钮即可生成无广告或推广内容的简要笔记,并生成分享图给好友 | 2024-04-24 | 正经人王同学 |
| Food-GPT-Yi-model | 2024-04-21 | Hubert S |
Yi 拥有完善的生态系统,提供一系列工具、服务和模型,旨在丰富您的使用体验并提升工作效率。
Yi 系列模型采用与 Llama 相同的模型架构。选择 Yi,您可以直接利用 Llama 生态系统中现有的工具、库和资源,无需重新开发新工具,从而提高开发效率。
例如,Yi 系列模型以 Llama 模型格式保存。您可以直接使用 LlamaForCausalLM 和 LlamaTokenizer 加载模型。有关更多信息,请参见 使用对话模型。
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("01-ai/Yi-34b", use_fast=False)
model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-34b", device_map="auto")[ 返回顶部 ⬆️ ]
💡 提示
欢迎创建 PR,分享您使用 Yi 系列模型构建的出色成果。
为帮助他人快速了解您的工作,建议使用
<model-name>: <model-intro> + <model-highlights>的格式。
如果您希望在几分钟内快速上手 Yi,可使用基于 Yi 构建的以下服务。
Yi-34B-Chat:您可以通过以下平台与 Yi 进行对话:
Yi-6B-Chat (Replicate):您可以通过设置额外参数和调用 API,使用更多选项来运行此模型。
ScaleLLM:您可以使用此服务在本地运行 Yi 模型,获得更高的灵活性和自定义空间。
如果您的计算资源有限,可以按以下方式使用 Yi 的量化模型。
这些量化模型降低了精度,但提高了效率,例如更快的推理速度和更低的内存占用。
如果您希望探索 Yi 丰富生态中的多样化能力,可以深入了解以下 Yi 的微调模型。
TheBloke Models:该网站托管了众多基于包括 Yi 在内的各种 LLM 微调的模型。
这并非 Yi 的完整列表,以下是按下载量排序的部分模型:
SUSTech/SUS-Chat-34B:该模型在所有 70B 以下模型中排名第一,性能优于规模两倍于它的 deepseek-llm-67b-chat。您可以在 Open LLM Leaderboard 上查看结果。
OrionStarAI/OrionStar-Yi-34B-Chat-Llama:在 OpenCompass LLM Leaderboard 的 C-Eval 和 CMMLU 评测中,该模型表现优于其他模型(如 GPT-4、Qwen-14B-Chat、Baichuan2-13B-Chat)。
NousResearch/Nous-Capybara-34B:该模型在 Capybara 数据集上以 20 万上下文长度和 3 个 epoch 进行训练。
[ 返回顶部 ⬆️ ]
有关 Yi 系列模型的详细能力,请参见 Yi: Open Foundation Models by 01.AI。
@misc{ai2024yi,
title={Yi: Open Foundation Models by 01.AI},
author={01. AI and : and Alex Young and Bei Chen and Chao Li and Chengen Huang and Ge Zhang and Guanwei Zhang and Heng Li and Jiangcheng Zhu and Jianqun Chen and Jing Chang and Kaidong Yu and Peng Liu and Qiang Liu and Shawn Yue and Senbin Yang and Shiming Yang and Tao Yu and Wen Xie and Wenhao Huang and Xiaohui Hu and Xiaoyi Ren and Xinyao Niu and Pengcheng Nie and Yuchi Xu and Yudong Liu and Yue Wang and Yuxuan Cai and Zhenyu Gu and Zhiyuan Liu and Zonghong Dai},
year={2024},
eprint={2403.04652},
archivePrefix={arXiv},
primaryClass={cs.CL}
}Yi-34B-Chat模型表现卓越,在MMLU、CMMLU、BBH、GSM8k等多项基准测试中,均位列所有现有开源模型之首。

*:C-Eval结果基于验证数据集进行评估
Yi-34B和Yi-34B-200K模型在开源模型中表现突出,尤其在MMLU、CMMLU、常识推理、阅读理解等方面表现卓越。

Yi-9B在一系列相似规模的开源模型(包括Mistral-7B、SOLAR-10.7B、Gemma-7B、DeepSeek-Coder-7B-Base-v1.5等)中几乎表现最佳,尤其在代码、数学、常识推理和阅读理解方面表现突出。

在整体能力(Mean-All)方面,Yi-9B在相似规模的开源模型中表现最佳,超过了DeepSeek-Coder、DeepSeek-Math、Mistral-7B、SOLAR-10.7B和Gemma-7B。

在编码能力(Mean-Code)方面,Yi-9B的性能仅次于DeepSeek-Coder-7B,超过了Yi-34B、SOLAR-10.7B、Mistral-7B和Gemma-7B。

在数学能力(Mean-Math)方面,Yi-9B的性能仅次于DeepSeek-Math-7B,超过了SOLAR-10.7B、Mistral-7B和Gemma-7B。

在常识与推理能力(Mean-Text)方面,Yi-9B的性能与Mistral-7B、SOLAR-10.7B和Gemma-7B相当。

[ 返回顶部 ⬆️ ]
所有人都可以!🙌 ✅
Yi 系列模型的代码和权重均依据 Apache 2.0 许可证 进行分发,这意味着 Yi 系列模型可免费用于个人用途、学术研究以及商业活动。
[ 返回顶部 ⬆️ ]
衷心感谢每一位为 Yi 社区做出贡献的成员!是你们的努力让 Yi 不仅仅是一个项目,更成为了一个充满活力、不断发展的创新家园。
[ 返回顶部 ⬆️ ]
在训练过程中,我们采用了数据合规性检查算法,以尽最大努力确保训练后模型的合规性。由于数据的复杂性以及语言模型使用场景的多样性,我们无法保证模型在所有场景下都能生成正确且合理的输出。请注意,模型仍存在产生问题输出的风险。对于因误用、误导、非法使用、相关错误信息以及任何相关数据安全问题所导致的任何风险和问题,我们不承担责任。
[ 返回顶部 ⬆️ ]
Yi-1.5 系列模型的代码和权重依据 Apache 2.0 许可证 进行分发。
如果您基于此模型创建衍生作品,请在您的衍生作品中包含以下归属信息:
本作品是基于 01.AI 的 [您所基于的 Yi 系列模型] 创作的衍生作品,使用遵循 Apache 2.0 许可证。
[ 返回顶部 ⬆️ ]