Skip to content

Commit

Permalink
Merge branch 'main' into jiangcheng_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
findmyway authored Dec 2, 2023
2 parents acad836 + 231bf09 commit 47596e1
Show file tree
Hide file tree
Showing 12 changed files with 391 additions and 105 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,21 @@ jobs:
echo "PRIMARY_TAG=$PRIMARY_TAG" >> "$GITHUB_OUTPUT"
echo "PRIMARY_TAG_SHORT=$(echo $PRIMARY_TAG | cut -d ':' -f1)" >> "$GITHUB_OUTPUT"
- name: Login to default container registry
if: matrix.runner == 'public'
uses: docker/login-action@v2
with:
registry: ${{ secrets.DEFAULT_REGISTRY }}
username: ${{ secrets.DEFAULT_REGISTRY_USER }}
password: ${{ secrets.DEFAULT_REGISTRY_PASSWORD }}
- name: Login to public container registry
if: matrix.runner == 'public'
uses: docker/login-action@v2
with:
registry: ${{ secrets.PUBLIC_REGISTRY }}
username: ${{ secrets.PUBLIC_REGISTRY_USER }}
password: ${{ secrets.PUBLIC_REGISTRY_PASSWORD }}
- name: Login to ghcr.io
if: matrix.runner == 'oversea'
uses: docker/login-action@v2
with:
registry: ghcr.io
Expand All @@ -106,4 +109,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=${{ steps.more-meta.outputs.PRIMARY_TAG_SHORT }}:buildcache
cache-to: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref && format('type=registry,image-manifest=true,ref={0}:buildcache,mode=max', steps.more-meta.outputs.PRIMARY_TAG_SHORT) || '' }}


75 changes: 75 additions & 0 deletions .github/workflows/sync_files.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Sync Files

on:
push:
branches:
- main

jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
is_readme_changed: ${{ steps.changed-files.outputs.readme_any_changed }}
is_license_changed: ${{ steps.changed-files.outputs.license_any_changed }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v40
with:
files_yaml: |
readme:
- README.md
- README/**
license:
- MODEL_LICENSE_AGREEMENT.txt
sync-readme:
runs-on: ${{ matrix.platform == 'huggingface' && 'ubuntu-latest' || 'public' }}
needs: detect-changes
if: needs.detect-changes.outputs.is_readme_changed == 'true' || needs.detect-changes.outputs.is_license_changed == 'true'
strategy:
matrix:
platform:
- huggingface
- modelscope
- wisemodel
repo:
- Yi-6B
- Yi-6B-200K
- Yi-6B-Chat
- Yi-6B-Chat-4bits
- Yi-6B-Chat-8bits
- Yi-34B
- Yi-34B-200K
- Yi-34B-Chat
- Yi-34B-Chat-4bits
- Yi-34B-Chat-8bits
steps:
- uses: actions/checkout@v4
- run: echo "REPO=${{ matrix.platform == 'huggingface' && format('https://{0}:{1}@huggingface.co/01-ai/{2}', secrets.HF_USER, secrets.HF_TOKEN, matrix.repo) || (matrix.platform == 'modelscope' && format('http://oauth2:{0}@www.modelscope.cn/01ai/{1}.git', secrets.MODELSCOPE_TOKEN, matrix.repo) || format('https://oauth2:{0}@www.wisemodel.cn/01.AI/{1}.git', secrets.WISEMODEL_TOKEN, matrix.repo))}}" >> $GITHUB_ENV
- run: GIT_LFS_SKIP_SMUDGE=1 git clone ${{ env.REPO }}
- if: needs.detect-changes.outputs.is_readme_changed == 'true' && matrix.platform == 'huggingface'
run: |
cat README/huggingface_header.md > ${{ matrix.repo }}/README.md
csplit README.md '/## Introduction/'
cat xx01 >> ${{ matrix.repo }}/README.md
- if: needs.detect-changes.outputs.is_readme_changed == 'true' && matrix.platform != 'huggingface'
run: |
cat README/${{matrix.platform}}_header.md > ${{ matrix.repo }}/README.md
cat README.md >> ${{ matrix.repo }}/README.md
- name: Sync LICENSE to ${{ matrix.platform }} ${{ matrix.repo }}
if: needs.detect-changes.outputs.is_license_changed == 'true'
run: |
cat MODEL_LICENSE_AGREEMENT.txt > ${{ matrix.repo }}/LICENSE
- run: |
cd ${{ matrix.repo }}
git config --global user.email "[email protected]"
git config --global user.name "yi-01-ai"
git add .
git commit --dry-run || exit 0
git commit -m "Auto Sync from ${{ github.repositoryUrl}}/commit/${{ github.sha}}"
git push ${{ env.REPO }}
33 changes: 0 additions & 33 deletions .github/workflows/sync_readme.yml

This file was deleted.

30 changes: 18 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,33 @@ ARG CUDA_VERSION="11.8.0"
FROM mambaorg/micromamba:1.5.1 as micromamba
FROM ${REGISTRY}/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu22.04 as base

#####
# Setup user & common tools
#####
RUN apt update \
&& apt install -y git ninja-build \
&& rm -rf /var/lib/apt/lists/*

#####
# Setup micromamba
#####

USER root

ARG MAMBA_USER=yi
ARG MAMBA_USER_ID=56789
ARG MAMBA_USER_GID=56789
ARG MAMBA_USER_ID=1000
ARG MAMBA_USER_GID=100
ENV MAMBA_USER=$MAMBA_USER
ENV MAMBA_ROOT_PREFIX="/opt/conda"
ENV MAMBA_EXE="/bin/micromamba"
ENV ENV_NAME=yi

ENV DEBIAN_FRONTEND="noninteractive"
ENV TZ="Asia/Shanghai"
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

RUN apt-get update -y \
&& apt-get install -y sudo tzdata git ninja-build \
&& useradd -ms /bin/bash -d /home/$MAMBA_USER $MAMBA_USER --uid $MAMBA_USER_ID --gid $MAMBA_USER_GID \
&& usermod -aG sudo $MAMBA_USER \
&& echo "$MAMBA_USER ALL=NOPASSWD: ALL" >> /etc/sudoers \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

COPY --from=micromamba "$MAMBA_EXE" "$MAMBA_EXE"
COPY --from=micromamba /usr/local/bin/_activate_current_env.sh /usr/local/bin/_activate_current_env.sh
COPY --from=micromamba /usr/local/bin/_dockerfile_shell.sh /usr/local/bin/_dockerfile_shell.sh
Expand All @@ -41,9 +47,9 @@ CMD ["/bin/bash"]

# Install dependencies

WORKDIR /yi
COPY ./conda-lock.yml .
WORKDIR /home/${MAMBA_USER}/workspace/Yi
COPY --chown=${MAMBA_USER_ID}:${MAMBA_USER_GID} ./conda-lock.yml .
RUN micromamba create -y -n ${ENV_NAME} -f conda-lock.yml && \
micromamba clean --all --yes

COPY . .
COPY --chown=${MAMBA_USER_ID}:${MAMBA_USER_GID} . .
1 change: 1 addition & 0 deletions HUGGINGFACE_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ and [`Yi-34B-200K`](https://huggingface.co/01-ai/Yi-34B-200K) are base model wit

## News

- 🔔 **2023/11/15**: The commercial licensing agreement for the **Yi** series models [is set to be updated](https://huggingface.co/01-ai/Yi-34B/discussions/28#65546af9198da1df586baaf2).
- 🎯 **2023/11/06**: The base model of [`Yi-6B-200K`](https://huggingface.co/01-ai/Yi-6B-200K)
and [`Yi-34B-200K`](https://huggingface.co/01-ai/Yi-34B-200K) with 200K context length.
- 🎯 **2023/11/02**: The base model of [`Yi-6B`](https://huggingface.co/01-ai/Yi-6B) and
Expand Down
79 changes: 40 additions & 39 deletions MODEL_LICENSE_AGREEMENT.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Yi Series Models License Agreement
Version: 2.0
Date of Release: November 4, 2023
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
License Agreement for the use, reproduction and distribution of Yi Series
Models.
“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
Expand All @@ -28,10 +28,10 @@ synthetic data based on Yi Series Models to train other models.
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
“Third Party” refers to any individuals, legal entities or non-legal
organizations other than you.

“Distribute” refers to transmitting, copying, publishing, or otherwise sharing
“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).
Expand All @@ -51,9 +51,7 @@ 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:
Expand Down Expand Up @@ -89,16 +87,18 @@ 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,
you should contact the Licensor in advance as specified in Section 7 of this
Agreement named "Updates to the Agreement and Contact Information" and obtain
written authorization from the Licensor. When you obtain authorization from the
Licensor to use the Yi Series Models and Derivatives for Commercial Purposes,
you must comply with the afore-mentioned license restrictions.
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: [email protected] 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.

Expand Down Expand Up @@ -190,35 +190,36 @@ For any questions related to licensing and copyright, please contact the
Licensor at [email protected].


Yi系列模型许可协议
版本: 2.0
发布日期: 2023年11月4日

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系列模型,直接或间接为实体或个人进行运营、推广或产生收入,或
用于任何其他盈利目的。
Expand All @@ -229,22 +230,21 @@ Yi-6B、Yi-34B等。
“个人信息”是指以电子或者其他方式记录的与已识别或者可识别的自然人有关的各种信息,
不包括匿名化处理后的信息。

“标识” 是指任何商标、服务标记、商号、域名、网站名称或其他带有显著品牌特征的标
记。
“标识” 是指任何商标、服务标记、商号、域名、网站名称或其他带有显著品牌特征的标记。


2. 许可及许可限制

许可方特此授予您非排他性、全球性、不可转让、不可再许可、可撤销、免版税的版权许
可。您必须满足如下许可限制条件:
许可方特此授予您非排他性、全球性、不可转让、不可再许可、可撤销、免版税的版权许可。
您必须满足如下许可限制条件:

1) 您对Yi系列模型的使用应遵守法律法规以及其他国家/地区适用的法律要求、尊重社会公
德和伦理道德。包括但不限于您不得将Yi系列模型用作危害国家安全、宣扬恐怖主义、极端
主义,宣扬民族及种族仇恨、歧视,暴力、色情,以及虚假有害信息等法律法规以及其他国
家/地区适用的法律要求禁止的目的。

2) 您不得出于军事或非法目的,或以法律法规以及其他国家/地区适用的法律要求所不允许
的方式a) 使用、复制、或分发Yi系列模型; 或b) 创建Yi系列模型的全部或部分衍生品。
的方式 a) 使用、复制、或分发Yi系列模型; 或 b) 创建Yi系列模型的全部或部分衍生品。

3) 您对Yi系列模型的使用(包括使用Yi系列模型的输出)以及模型衍生品的创建不得侵犯
任何第三方的合法权益,包括但不限于他人肖像权、名誉权、隐私权等人格权,著作权、专
Expand All @@ -257,10 +257,11 @@ Yi-6B、Yi-34B等。
改不得违反本协议的许可限制条件,也不能允许、协助或以其他方式使得第三方违反本协议
中的许可限制条件。

如果您计划将 Yi系列模型及模型衍生品用作商业用途,您应当事先通过第7款“协议更新及
联系方式”中的方式联系许可方进行登记并获得许可方的书面授权。若您取得许可方授权将
Yi系列模型及模型衍生品用作商业用途时,您应满足许可方上述许可限制条件。

如果您计划将Yi系列模型及模型衍生品用作商业用途,请参见《Yi系列模型商用许可协议》
(参见:https://www.lingyiwanwu.com/yi-license)附件一《Yi系列模型商用登
记表》(“登记表”)并将填写完毕的登记表发送至 [email protected] 邮箱完成登记即可获得商用
许可。若您获得商用许可并将Yi系列模型及模型衍生品用作商业用途,您应满足许可方上述
许可限制条件及《Yi系列模型商用许可协议》中的商业许可限制。

3. 知识产权

Expand Down Expand Up @@ -319,5 +320,5 @@ Yi系列模型按“原样”提供。许可方不对Yi系列模型提供任何

7. 协议更新及联系方式

许可方有权对协议进行不时更新。许可方将通过https://01.ai公布协议最新版本。有关许
可和版权的任何问题,请通过yi@01.ai 与许可方联系。
许可方有权对协议进行不时更新。许可方将通过 https://01.ai 公布协议最新版本。有关
许可和版权的任何问题,请通过 yi@01.ai 与许可方联系。
Loading

0 comments on commit 47596e1

Please sign in to comment.