2 Star 9 Fork 2

Gitee 极速下载 / Yi-LLM

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/01-ai/Yi
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

English   | &nbsp中文&nbsp



打造下一代开源双语大语言模型

🤗 Hugging Face • 🤖 魔搭 ModelScope • ✡️ 始智 WiseModel

👩‍🚀 欢迎来 GitHub Discussions 讨论问题

👋 欢迎加入 👾 Discord 或者 💬 微信群 一起交流

📝 欢迎查阅 Yi 技术报告 了解更多

📚 欢迎来 Yi 学习中心 探索新知



📕 目录

📌 Yi 是什么?

介绍

  • 🤖 Yi 系列模型是 01.AI 从零训练的下一代开源大语言模型。

  • 🙌 Yi 系列模型是一个双语语言模型,在 3T 多语言语料库上训练而成,是全球最强大的大语言模型之一。Yi 系列模型在语言认知、常识推理、阅读理解等方面表现优异。例如,

    • Yi-34B-Chat 模型在 AlpacaEval Leaderboard 排名第二仅次于 GPT-4 Turbo,超过了 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 开源社区,不仅简化了开发者从零开始构建大模型的工作,开发者还可以利用 Llama 生态中现有的工具、库和资源,提高开发效率。

    如果你对 Yi 使用 Llama 架构及其许可使用政策感兴趣,参阅 「Yi 与 Llama 的关系」。 ⬇️

💡 简短总结

Yi 系列模型采用与Llama相同的模型架构,但它们不是 Llama 的衍生品。

  • Yi 和 Llama 都是基于 Transformer 结构。实际上,自 2018 年以来,Transformer 一直是大语言模型的常用架构。

  • 在 Transformer 架构的基础上,Llama 凭借出色的稳定性、可靠的收敛性和强大的兼容性,成为大多数先进开源模型的基石。因此,Llama 也成为 Yi 等模型的基础框架。

  • 得益于 Transformer 和 Llama 架构,各类模型可以简化从零开始构建模型的工作,并能够在各自的生态中使用相同的工具。

  • 然而,Yi 系列模型不是 Llama 的衍生品,因为它们不使用 Llama 的权重。

    • 虽然大多数开源模型都采用了 Llama 的架构,但决定模型表现的关键因素是训练所使用的数据集、训练管道及其基础设施。

    • 01.AI 用独特的方式开发了 Yi 系列模型,从零开始创建了自己的高质量训练数据集、高效的训练流水线和强大的训练基础设施,因此 Yi 系列模型性能优异,在 Alpaca Leaderboard 上排名仅次于 GPT-4,超过了 Llama(数据截止至 2023 年 12 月)。

[ 返回顶部 ⬆️ ]

最新动态

🎯 2024-03-16:发布并开源了 Yi-9B-200K 模型。
🎯 2024-03-08: 发布了 Yi 技术报告
🔔 2024-03-07: 增强了 Yi-34B-200K 长文本记忆和检索能力。
Yi-34B-200K 的“大海捞针”能力增强了 10.5%, 从 89.3% 提升到了 99.8%。 在 5B tokens 的长文本数据集上,对模型进行继续预训练,模型性能达到预期目标。

🎯 2024-03-06: 发布并开源了 Yi-9B 模型。
Yi-9B 模型在 Mistral-7B、SOLAR-10.7B、Gemma-7B、DeepSeek-Coder-7B-Base-v1.5 等相近尺寸的模型中名列前茅,具有出色的代码能力、数学能力、常识推理能力以及阅读理解能力。

🎯 2024-01-23: 发布并开源了 Yi-VL-34BYi-VL-6B 多模态语言大模型。
Yi-VL-34BMMMUCMMMU 最新的基准测试中荣登榜首(数据截止至 2024 年 1 月)。

🎯 2023-11-23: 发布并开源了六大 Chat 模型。
其中,两个 4-bits 模型由 AWQ 量化,两个 8-bits 模型由 GPTQ 量化。
  • Yi-34B-Chat
  • Yi-34B-Chat-4bits
  • Yi-34B-Chat-8bits
  • Yi-6B-Chat
  • Yi-6B-Chat-4bits
  • Yi-6B-Chat-8bits
🔔 2023-11-23: Yi 系列模型社区许可协议更新至 2.1 版本
🔥 2023-11-08: Yi-34B-Chat 模型开始邀请测试。

如需申请测试,你可以填写英文中文申请表。

🎯 2023-11-05: 发布并开源了 Yi-6B-200KYi-34B-200K Base 模型。
这两个 Base 模型与之前发布的 Base 模型的参数规模相同,并且上下文窗口扩展到了 200K。
🎯 2023-11-02: 发布并开源了 Yi-6B-BaseYi-34B-Base 模型。
首次发布并开源了两个 Base 模型(支持中英双语),参数规模分别为 6B 和 34B。两者均以 4K 序列长度进行训练,在推理时可扩展到 32K。

[ 返回顶部 ⬆️ ]

模型

Yi 系列模型有多种参数规模,适用于不同的使用场景。你也可以对Yi模型进行微调,从而满足特定需求。

如需部署 Yi 系列模型,应确保软件和硬件满足「部署要求」.

Chat 模型

模型 下载
Yi-34B-Chat 🤗 Hugging Face🤖 ModelScope
Yi-34B-Chat-4bits 🤗 Hugging Face🤖 ModelScope
Yi-34B-Chat-8bits 🤗 Hugging Face🤖 ModelScope
Yi-6B-Chat 🤗 Hugging Face🤖 ModelScope
Yi-6B-Chat-4bits 🤗 Hugging Face🤖 ModelScope
Yi-6B-Chat-8bits 🤗 Hugging Face🤖 ModelScope

- 4-bits 系列模型由AWQ量化。
- 8-bits 系列模型由GPTQ量化。
- 所有量化模型的使用门槛较低,因此可以在消费级GPU(例如,3090、4090)上部署。

Base 模型

模型 下载
Yi-34B 🤗 Hugging Face🤖 ModelScope
Yi-34B-200K 🤗 Hugging Face🤖 ModelScope
Yi-9B 🤗 Hugging Face🤖 ModelScope
Yi-9B-200K 🤗 Hugging Face🤖 ModelScope
Yi-6B 🤗 Hugging Face🤖 ModelScope
Yi-6B-200K 🤗 Hugging Face🤖 ModelScope

- 200K 大约相当于 40 万个汉字。
- 如果你想用 Yi-34B-200K 更早的版本 (即 2023 年 11 月 5 日发布的版本),可以运行代码 git checkout 069cd341d60f4ce4b07ec394e82b79e94f656cf,下载权重。

模型信息

  • For chat and base models

Model | Intro | 默认的上下文窗口 | 预训练的 tokens 数量 | 训练数据

Model Intro 默认的上下文窗口 预训练的 tokens 数量 训练数据
6B 系列模型 适合个人和学术使用。 4K 3T 截至 2023 年 6 月。
9B 系列模型 是 Yi 系列模型中代码和数学能力最强的模型。 Yi-9B 是在 Yi-6B 的基础上,使用了 0.8T tokens 进行继续训练。
34B 系列模型 适合个人、学术和商业用途(尤其对中小型企业友好)。
34B 模型尺寸在开源社区属于稀缺的“黄金比例”尺寸,已具大模型涌现能力,适合发挥于多元场景,满足开源社区的刚性需求。
3T
  • Chat 模型

    关于 Chat 模型的局限性,参阅以下解释。 ⬇️

      Chat 模型在训练中采用了监督微调(SFT)技术。与其它常规 Chat 模型相比, Yi 系列模型生成的回复更加多样化,(1)因此适用于各种下游任务,例如,创意场景;(2)有利于提高回复的质量,对后续的强化学习(RL)训练帮助很大。


      注意,回复多样化也可能会导致某些已知问题更加严重,例如,

    • 幻觉:即模型可能会生成错误或不连贯的信息。模型回复多样化,更有可能出现幻觉,这些幻觉可能不是基于准确的数据或逻辑推理。
    • 重新生成的回复不一致:重新生成回复或者对回复进行采样时,结果可能出现前后不一致。多样性增多会导致即使在相似的输入条件下,结果也会存在差异。
    • 累积误差:当模型回复的错误随时间累积,就会出现累计误差的现象。模型回复的多样化增加了小误差积累成大错误的可能性,这种情况常见于扩展推理、解决数学问题等复杂任务中。
    • 为了获得更连贯一致的回复,建议调整生成配置参数,例如,温度、top_p 和 top_k。这些调整既可以让模型的回复富有创意,又能保持逻辑上的连贯性。

[ 返回顶部 ⬆️ ]

📌 如何使用 Yi?

快速上手

你可以选择一条学习路径,开始使用 Yi 系列模型。

选择学习路径

你可以根据自身需求,选择以下方式之一,开始你的 Yi 之旅。

选择学习路径

🎯 在本地部署 Yi

如果你想在本地部署 Yi 模型,

  • 🙋‍♀️ 并且你有足够的资源(例如,NVIDIA A800 80GB),你可以选择以下方式之一。
  • 🙋‍♀️ 但你的资源有限(例如,一台 MacBook Pro),你可以使用 llama.cpp

🎯 不在本地部署 Yi 模型

如果你不想在本地部署 Yi 模型,你可以选择以下方式之一。

🙋‍♀️ 使用 Yi API

如果你想探索 Yi 的更多功能,你可以选择以下方式之一。

  • Yi APIs (Yi 官方)

    • 部分申请者已获取 Yi API keys。Yi 将开放更多 API keys,敬请期待。
  • Yi APIs (Replicate,第三方网站)

🙋‍♀️ 使用 Yi Playground

如果你想与 Yi 聊天,并使用更多自定义选项(例如,系统提示、温度、重复惩罚等),你可以选择以下方式之一。

🙋‍♀️ 使用 Yi Chat

以下提供了类似的用户体验,你可以选择以下方式之一,与 Yi 聊天。

  • Yi-34B-Chat(Yi 官方 - Hugging Face)

    • 不需要注册。
  • Yi-34B-Chat(Yi 官方)

    • 如需使用官方在线聊天服务,欢迎申请加入白名单(填写英文中文申请表)。

[ 返回顶部 ⬆️ ]

快速上手 - PyPi (pip install)

本教程在配置为 A800(80GB) 的本地机器上运行 Yi-34B-Chat, 并进行推理。

第 0 步:前提条件

  • 确保安装了 Python 3.10 以上版本。

  • 如果你想运行 Yi 系列模型,参阅「部署要求」。

第 1 步:准备环境

如需设置环境,安装所需要的软件包,运行下面的命令。

git clone https://github.com/01-ai/Yi.git
cd yi
pip install -r requirements.txt

第 2 步:下载模型

你可以从以下来源下载 Yi 模型。

第 3 步:进行推理

你可以使用 Yi Chat 模型或 Base 模型进行推理。

使用 Yi Chat 模型进行推理
  1. 创建一个名为 quick_start.py 的文件,并将以下内容复制到该文件中。

    from transformers import AutoModelForCausalLM, AutoTokenizer
    
    model_path = '<your-model-path>'
    
    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)
  2. 运行 quick_start.py 代码。

    python quick_start.py

    你将得到一个类似输出,如下所示。🥳

    Hello! How can I assist you today?
使用 Yi Base 模型进行推理
  • Yi-34B

步骤与「使用 Yi Chat 模型进行推理」类似。

你可以使用现有文件 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

🚀 教程:在本地 Docker 上运行 Yi-34B-Chat。⬇️
本教程在本地 Docker(配置为 A800 GPU 或 4*4090)上运行 Yi-34B-Chat 模型,并进行推理。

第 0 步:准备工作

确保你已经安装了 Dockernvidia-container-toolkit

第 1 步:启动 Docker

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 镜像。

第 2 步:进行推理

你可以使用 Yi 的 Chat 模型或 Base 模型进行推理。

使用 Yi Chat 模型进行推理

进行推理的步骤与「 在 pip 上使用 Yi Chat 模型进行推理 」类似。

注意: 唯一不同的是你需要设置 model_path= '<your-model-mount-path>' 而不是 = '<your-model-path>'

使用 Yi Base 模型进行推理

进行推理的步骤与「 在 pip 上使用 Yi Chat 模型进行推理 」类似。

注意: 唯一不同的是你需要设置 model_path= '<your-model-mount-path>' 而不是 = '<your-model-path>'

快速上手 - conda-lock

🚀 如需创建一个可以完全重现的 conda 环境锁定文件,你可以使用 conda-lock 工具。 ⬇️
你可以参考 conda-lock.yml 文件,该文件包含了所需依赖项的具体版本信息。此外,你还可以使用micromamba工具来安装这些依赖项。
安装这些依赖项的步骤,如下所示。
  1. 根据指南安装 "micromamba"。

  2. 运行命令 micromamba install -y -n yi -f conda-lock.yml ,创建一个名为yi conda 环境,并安装所需的依赖项。

快速上手 - llama.cpp

🚀 教程:在本地 llama.cpp 上运行 Yi-chat-6B-2bits。⬇️
本教程在本地 llama.cpp 上运行 Yi-chat-6B-2bits 量化模型,并进行推理。

步骤 0:前提条件

  • 该教程适用于 MacBook Pro(16GB 内存和 Apple M2 Pro 芯片)。

  • 确保你的电脑上安装了 git-lfs

步骤 1:下载 llama.cpp

如需克隆 llama.cpp 仓库,运行以下命令。

git clone git@github.com:ggerganov/llama.cpp.git

步骤 2:下载模型

步骤 2.1:仅下载 XeIaso/yi-chat-6B-GGUF 仓库的 pointers,运行以下命令。

GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/XeIaso/yi-chat-6B-GGUF

步骤 2.2:下载量化后的 Yi 模型 yi-chat-6b.Q2_K.gguf,运行以下命令。

git-lfs pull --include yi-chat-6b.Q2_K.gguf

步骤 3:进行推理

如需体验 Yi 模型(运行模型推理),你可以选择以下方式之一。

方式 1:在终端中进行推理

本文使用 4 个线程编译 llama.cpp ,之后进行推理。在 llama.cpp 所在的目录,运行以下命令。

提示
  • /Users/yu/yi-chat-6B-GGUF/yi-chat-6b.Q2_K.gguf 替换为你的模型的实际路径。

  • 默认情况下,模型是续写模式(completion mode)。

  • 如需查看更多自定义选项(例如,系统提示、温度、重复惩罚等),运行 ./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 模型提出了问题,得到了回复!🥳

方式 2:在 Web上进行推理
  1. 如需启用一个轻便敏捷的聊天机器人,你可以运行以下命令。

    ./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
  2. 如需访问聊天机器人界面,可以打开网络浏览器,在地址栏中输入 http://0.0.0.0:8080

    Yi模型聊天机器人界面 - LLaMA.cpp

  3. 如果你在提示窗口中输入问题,例如,“如何喂养你的宠物狐狸?请用 6 个简单的步骤回答”,你将收到类似的回复。

    向 Yi 模型提问 - LLaMA.cpp

[ 返回顶部 ⬆️ ]

快速上手 - 使用 Web demo

你可以使用 Yi Chat 模型(Yi-34B-Chat)创建 Web demo。 注意:Yi Base 模型(Yi-34B)不支持该功能。

第一步:准备环境

第二步:下载模型

第三步:启动 Web demo 服务,运行以下命令。

python demo/web_demo.py -c <你的模型路径>

命令运行完毕后,你可以在浏览器中输入控制台提供的网址,来使用 Web demo 功能。

快速上手 -  Web demo

[ 返回顶部 ⬆️ ]

微调

bash finetune/scripts/run_sft_Yi_6b.sh

完成后,你可以使用以下命令,比较微调后的模型与 Base 模型。

bash finetune/scripts/run_eval.sh
你可以使用 Yi 6B 和 34B Base 模型的微调代码,根据你的自定义数据进行微调。 ⬇️

    准备工作

    从镜像开始

    默认情况下,我们使用来自BAAI/COIG 的小型数据集来微调 Base 模型。 你还可以按照以下 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。如需安装 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 模型,注意此模式采用零卸载技术,占用了大量 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),每个 GPU 的内存大于 80GB,总 CPU 内存大于900GB。

快速上手

将 LLM-base 模型下载到 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
|   |-- ...

将数据集从 Hugging Face 下载到本地存储 DATA_PATH,例如, Dahoas/rm-static。

|-- $DATA_PATH
|   |-- data
|   |   |-- train-00000-of-00001-2a1df75c6bce91ab.parquet
|   |   |-- test-00000-of-00001-8c7c51afc6d45980.parquet
|   |-- dataset_infos.json
|   |-- README.md

finetune/yi_example_dataset 中有示例数据集,这些数据集是从 BAAI/COIG修改而来。

|-- $DATA_PATH
    |--data
        |-- train.jsonl
        |-- eval.jsonl

cd 进入 scripts 文件夹,复制并粘贴脚本,然后运行。你可以使用以下代码完成此项。

cd finetune/scripts

bash run_sft_Yi_6b.sh

对于 Yi-6B-Base 模型,设置 training_debug_steps=20 和 num_train_epochs=4, 就可以输出一个 Chat 模型,大约需要 20 分钟。

对于 Yi-34B-Base 模型,初始化时间相对较长,请耐心等待。

评估

cd finetune/scripts

bash run_eval.sh

你将得到 Base 模型和微调模型的回复。

[ 返回顶部 ⬆️ ]

量化

GPT-Q 量化

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_code
详细的量化过程。 ⬇️

    GPT-Q 是一种后训练量化方法,能够帮助大型语言模型在使用时节省内存,保持模型的准确性,并加快模型的运行速度。

    如需对 Yi 模型进行 GPT-Q 量化,使用以下教程。

    运行 GPT-Q 需要使用 AutoGPTQexllama。 此外,Hugging Face Transformers 已经集成了 optimum 和 auto-gptq,能够实现语言模型的 GPT-Q 量化。

    量化模型

    如需量化模型,你可以使用以下 quant_autogptq.py 脚本。

python 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_code

AWQ 量化

python 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_code
详细的量化过程。⬇️

    AWQ是一种后训练量化方法,可以将模型的权重数据高效准确地转化成低位数据(例如,INT3 或 INT4),因此可以减小模型占用的内存空间,保持模型的准确性。

    如需对 Yi 模型进行 AWQ 量化,你可以使用以下教程。

    运行 AWQ 需要使用 AutoAWQ

    量化模型

    如需量化模型,你可以使用以下 quant_autoawq.py 脚本。

python 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-bits 量化模型 AWQ 和 CUDA
Yi 8-bits 量化模型 GPTQ 和 CUDA

硬件要求

部署 Yi 系列模型之前,确保硬件满足以下要求。

Chat 模型
模型 最低显存 推荐 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 使用情况下的最低显存要求。

模型 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
Base 模型
模型 最低显存 推荐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)

FAQ

如果你在使用 Yi 系列模型过程中遇到任何疑问,以下的答疑内容可以为你提供参考。⬇️

💡微调

  • 如何选择在 Base 模型上微调还是在 Chat 模型上微调?
    选择适合微调的预训练语言模型时,你需要根据可用的计算资源和具体任务的需求来做出决定。
    • 如果你有大量的微调数据(例如,超过 10,000 条样本),可以选择 Base 模型。
    • 如果你的微调数据量不大,选择 Chat 模型更合适。
    • 建议在 Base 模型和 Chat 模型上都进行微调,比较两者的性能,选择适合的模型,满足特定需求。
  • 使用 Yi-34B 和 Yi-34B-Chat 进行全量微调,两者之间有什么区别?
    Yi-34B 和 Yi-34B-Chat 在进行全量微调时的主要区别在于微调的策略和结果。
    • Chat 模型采用特殊的微调(SFT)方式,生成的回答更符合人类的交谈风格。
    • Base 模型的微调则更加通用,性能上限相对较高。
    • 如果你对自己的数据质量有充足的信心,可以选择使用 Yi-34B 进行微调。
    • 如果你希望模型生成的回答能更好地模仿人类的交谈风格,或对自己的数据质量不够自信,可以选择使用 Yi-34B-Chat 进行微调。

💡量化

  • 量化版模型和原版模型在性能上有何差异?
    • 性能差异在很大程度上取决于所使用的量化方法,以及这些模型应用的具体场景。以 AWQ 官方提供的模型为例,从客观的 Benchmark 来看,量化可能会导致性能下降几个百分点。
    • 从主观的角度来看,例如,在逻辑推理这类场景中,即使只有 1% 的性能差异,也可能影响输出结果的正确性。

💡通用

  • 我可以在哪里获取微调的问答数据集?

    • 你可以在Hugging Face 上可以微调的问答数据集,例如 m-a-p/COIG-CQIA
    • 另外,你可以在 Github 上获取微调框架,例如,hiyouga/LLaMA-Factory 整合了现成的数据集。
  • Yi-34B FP16 的微调需要多少 GPU 内存?
    进行 34B FP16 的微调,所需的 GPU 内存量取决于具体的微调方式。进行全参数微调,需要 8 张 80 GB的显卡;而Lora 等低资源方案,需要的资源较少。你可以参考 hiyouga/LLaMA-Factory,获取更多信息。同时,建议你使用 BF16 代替 FP16 来进行微调,优化性能。

  • Yi-34b-200k 有第三方 Chat 平台吗?
    如果你想访问第三方 Chat,可以选择人工智能平台 fireworks.ai

学习中心

如果你想学习如何使用 Yi 系列模型,这里有丰富的学习资源。 ⬇️

欢迎来到 Yi 学习中心!

无论你是经验丰富的专家还是初出茅庐的新手,你都可以在这里找到丰富的学习资源,增长有关 Yi 模型的知识,提升相关技能。这里的博客文章具有深刻的见解,视频教程内容全面,实践指南可实操性强,这些学习资源都可以助你一臂之力。

感谢各位 Yi 专家和用户分享了许多深度的技术内容,我们对各位小伙伴的宝贵贡献表示衷心的感谢!

在此,我们也热烈邀请你加入我们,为 Yi 做出贡献。如果你创作了关于 Yi 系列模型的内容,欢迎提交 PR 分享!🙌

有了这些学习资源,你可以立即开启 Yi 学习之旅。祝学习愉快!🥳

教程

英文教程
类型 教程 日期 作者
博客 Running Yi-34B-Chat locally using LlamaEdge 2023-11-30 Second State
视频 Install Yi 34B Locally - Chinese English Bilingual LLM 2023-11-05 Fahd Mirza
视频 Dolphin Yi 34b - Brand New Foundational Model TESTED 2023-11-27 Matthew Berman
中文教程
类型 教程 日期 作者
GitHub 项目 基于零一万物 Yi 模型和 B 站构建大语言模型高质量训练数据集 2024-04-29 正经人王同学
GitHub 项目 基于视频网站和零一万物大模型构建大语言模型高质量训练数据集 2024-04-25 正经人王同学
博客 基于零一万物yi-vl-plus大模型简单几步就能批量生成Anki图片笔记 2024-04-24 正经人王同学
GitHub 项目 基于零一万物yi-34b-chat-200k输入任意文章地址,点击按钮即可生成无广告或推广内容的简要笔记,并生成分享图给好友 2024-04-24 正经人王同学
博客 实测零一万物Yi-VL多模态语言模型:能准确“识图吃瓜” 2024-02-02 苏洋
博客 本地运行零一万物 34B 大模型,使用 LLaMA.cpp & 21G 显存 2023-11-26 苏洋
博客 零一万物模型折腾笔记:官方 Yi-34B 模型基础使用 2023-12-10 苏洋
博客 CPU 混合推理,非常见大模型量化方案:“二三五六” 位量化方案 2023-12-12 苏洋
博客 单卡 3 小时训练 Yi-6B 大模型 Agent:基于 LLaMA Factory 实战 2024-01-22 郑耀威
博客 零一万物开源Yi-VL多模态大模型,魔搭社区推理&微调最佳实践来啦! 2024-01-26 ModelScope
视频 只需 24G 显存,用 vllm 跑起来 Yi-34B 中英双语大模型 2023-12-28 漆妮妮
视频 Yi-VL-34B 多模态大模型 - 用两张 A40 显卡跑起来 2023-01-28 漆妮妮

📌 为什么选择 Yi?

生态

Yi 生态为你提供一系列工具、服务和模型,你将获得丰富的体验,最大程度提升工作工作效率。

上游

Yi 系列模型遵循与 Llama 相同的模型架构。选择 Yi,你可以利用 Llama 生态中现有的工具、库和资源,无需创建新工具,提高开发效率。

例如,Yi 系列模型以 Llama 模型的格式保存。你可以直接使用 LlamaForCausalLMLlamaTokenizer 加载模型,使用以下代码。

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")

[ 返回顶部 ⬆️ ]

下游

💡 提示

  • 如果你开发了与 Yi 相关的服务、模型、工具、平台或其它内容,欢迎提交 PR,将你的成果展示在 Yi 生态

  • 为了帮助他人快速理解你的工作,建议使用<模型名称>: <模型简介> + <模型亮点>的格式。

下游 - 服务

如果你想在几分钟内开始使用 Yi,你可以使用以下基于 Yi 构建的服务。

下游 - 量化

如果资源有限,你可以使用 Yi 的量化模型,如下所示。

这些量化模型虽然精度降低,但效率更高,例如,推理速度更快,RAM 使用量更小。

下游 - 微调

如果你希望探索 Yi 的其它微调模型,你可以尝试以下方式。

下游 - API

  • amazing-openai-api:此工具可以将 Yi 模型 API 转换成 OpenAI API 格式。
  • LlamaEdge:你可以通过该工具快速部署 Yi-34B-Chat 并开始聊天。该工具由 Rust 语言开发,使用可移植的 Wasm(WebAssembly)文件构建了一个与 OpenAI 兼容的 API 服务器。

[ 返回顶部 ⬆️ ]

基准测试

Chat 模型性能

Yi-34B-Chat 模型表现出色,在 MMLU、CMMLU、BBH、GSM8k 等所有开源模型的基准测试中排名第一。

Chat model performance

测评方法与挑战 ⬇️
  • 评估方式: 该测评使用 zero-shot 和 few-shot 方法评估了除 TruthfulQA 以外的各种基准。
  • zero-shot 方法: 大部分 Chat 模型常用 zero-shot 方法。
  • 评估策略: 本次测评的评估策略是要求模型在给出明确指令或包含隐含信息的指令情况下遵循指令(例如,使用少量样本示例),生成回应,并从生成的文本中提取相关答案。
  • 面临的挑战: 一些模型不适用少数数据集中的指令,无法按照所要求的特定格式产生输出,这会导致结果不理想。

*: C-Eval 的结果来源于验证数据集。

Base 模型性能

Yi-34B 和 Yi-34B-200K

Yi-34B 和 Yi-34B-200K 模型在开源模型中脱颖而出,尤其在 MMLU、CMMLU、常识推理、阅读理解等方面表现卓越。

Base model performance

测评方法 ⬇️
  • 结果差异: 在测试开源模型时,该测试的流程与其它测试方法(例如,OpenCompass)报告的结果之间存在差异。
  • 结果发现: 测评结果显示,各种模型在 Prompt、后处理策略和采样技术上的不同之处可能导致各种模型的结果产生显著差异。
  • 相同的测试过程: 该测试的方法论与原始基准一致,即在评估时使用相同的提示语和后处理策略,并在评估时应用贪心解码(greedy decoding),不对生成内容进行任何后处理。
  • 测评其它模型: 对于未提供测评结果的模型(包括以不同设置报告的分数),该测评尝试使用自身的流程获取结果。
  • 评估维度全面: 为了全面评估模型的能力,该测评采用了在 Llama2 中概述的方法。具体而言,针对尝试推理方面,该测评使用了 PIQA、SIQA、HellaSwag、WinoGrande、ARC、OBQA 和 CSQA 等方法。针对阅读理解方面,该测评使用了 SquAD、QuAC 和 BoolQ 等方法。
  • 特殊设置: CSQA 专门使用 7-shot 设置进行测试,而其它所有测试都使用 0-shot 设置进行。此外,该测评在“数学和编码”类别下引入了 GSM8K(8-shot@1)、MATH(4-shot@1)、HumanEval(0-shot@1)和 MBPP(3-shot@1)。
  • Falcon-180B 注意事项: 由于技术限制,Falcon-180B 没有在 QuAC 和 OBQA 上进行测试。评测结果是其它任务的平均分数,通常而言, QuAC 和 OBQA 的分数较低。本次评估结果可能相对合理地反映了 Falcon-180B 的表现,没有低估它的性能。

Yi-9B

Yi-9B 模型在 Mistral-7B、SOLAR-10.7B、Gemma-7B、DeepSeek-Coder-7B-Base-v1.5 等相近尺寸的模型中名列前茅,具有出色的代码能力、数学能力、常识推理能力以及阅读理解能力。

Yi-9B benchmark - details

  • 综合能力方面(Mean-All),Yi-9B 的性能在尺寸相近的开源模型中最好,超越了 DeepSeek-Coder、DeepSeek-Math、Mistral-7B、SOLAR-10.7B 和 Gemma-7B。

    Yi-9B benchmark - overall

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

    Yi-9B benchmark - code

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

    Yi-9B benchmark - math

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

    Yi-9B benchmark - text

[ 返回顶部 ⬆️ ]

技术报告

更多关于 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?

答案是所有人! 🙌 ✅

关于如何使用 Yi 系列模型,参阅「许可证」。

[ 返回顶部 ⬆️ ]

📌 其它

致谢

我们对每位火炬手都深表感激,感谢你们为 Yi 社区所做的贡献。因为有你们,Yi 不仅是一个项目,还成为了一个充满活力的创新社区。我们由衷地感谢各位小伙伴!

yi contributors

本文贡献者

Yi Readme 中文版由以下贡献者完成,排名不分先后,以用户名首字母顺序排列。

[ 返回顶部 ⬆️ ]

免责声明

在训练过程中,我们使用数据合规性检查算法,最大程度地确保训练模型的合规性。由于数据复杂且语言模型使用场景多样,我们无法保证模型在所有场景下均能生成正确合理的回复。注意,模型仍可能生成有误的回复。对于任何因误用、误导、非法使用、错误使用导致的风险和问题,以及与之相关的数据安全问题,我们均不承担责任。

[ 返回顶部 ⬆️ ]

许可证

本仓库中的源代码遵循 Apache 2.0 许可证

[ 返回顶部 ⬆️ ]

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2024 01.AI Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Yi 系列大模型包括 Yi-34B 和 Yi-6B,支持中英文双语,号称对学术研究完全开放,同步开放免费商用申请 展开 收起
Python 等 3 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/Yi-LLM.git
git@gitee.com:mirrors/Yi-LLM.git
mirrors
Yi-LLM
Yi-LLM
main

搜索帮助

344bd9b3 5694891 D2dac590 5694891