Skip to content

Commit 34d545f

Browse files
authored
Merge pull request FlagAI-Open#16 from FlagAI-Open/master
update
2 parents 4253578 + 63faf71 commit 34d545f

File tree

352 files changed

+526986
-535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+526986
-535
lines changed

.github/workflows/python-app.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a single version of Python
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4+
45
name: Python application
56

67
on:
@@ -19,10 +20,10 @@ jobs:
1920

2021
steps:
2122
- uses: actions/checkout@v3
22-
- name: Set up Python 3.10
23+
- name: Set up Python 3.9
2324
uses: actions/setup-python@v3
2425
with:
25-
python-version: "3.10"
26+
python-version: "3.9"
2627
- name: Install dependencies
2728
run: |
2829
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
deploy:
14-
runs-on: ubuntu-18.04
14+
runs-on: self-hosted
1515
steps:
1616
- uses: actions/checkout@v3
1717
- name: Set up Python
@@ -28,4 +28,4 @@ jobs:
2828
uses: pypa/gh-action-pypi-publish@release/v1
2929
with:
3030
user: __token__
31-
password: ${{ secrets.PYPI_API_TOKEN }}
31+
password: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

100644100755
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ test_report
1919
/data/
2020
/tests/*/data
2121
checkpoints
22+
checkpoints_in
23+
checkpoints_out
2224
state_dict
2325
checkpoints*
2426
vocabs
@@ -28,3 +30,9 @@ qqp
2830
glm_large_qqp_pytorch
2931
wandb
3032
clip_benchmark_datasets
33+
examples/AltCLIP/clip_benchmark_datasets
34+
examples/glm_pretrain/data.lazy
35+
examples/glm_pretrain/examples/glm_pretrain/data.lazy
36+
examples/vit_cifar100/cifar100
37+
examples/vit_cifar100/data
38+
output/

BAAI_Aquila_Model_License.pdf

220 KB
Binary file not shown.

CHANGELOG.md

100644100755
File mode changed.

CLA.md

100644100755
File mode changed.

CODE_OF_CONDUCT.md

100644100755
File mode changed.

COMMITTERS.csv

100644100755
File mode changed.

CONTRIBUTING.md

100644100755
File mode changed.

Dockerfile

100644100755
Lines changed: 59 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,61 @@
1-
#Change to your base image, such as pytorch1.11+py38
2-
#https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel_21-02.html#rel_21-02
3-
FROM nvcr.io/nvidia/pytorch:21.06-py3
4-
#You can set available pypi sources
5-
RUN /bin/bash -c "pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple"
6-
7-
ENV STAGE_DIR=/tmp
8-
RUN mkdir -p ${STAGE_DIR}
9-
#Ubuntu
10-
RUN apt-get update && apt-get install -y openssh-server && apt-get install -y git
11-
ARG SSH_PORT=6001
12-
#Client Liveness & Uncomment Port 22 for SSH Daemon
13-
RUN echo "ClientAliveInterval 30" >> /etc/ssh/sshd_config
14-
RUN mkdir -p /var/run/sshd && cp /etc/ssh/sshd_config ${STAGE_DIR}/sshd_config && \
15-
sed "0,/^#Port 22/s//Port 22/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config
16-
RUN cat /etc/ssh/sshd_config > ${STAGE_DIR}/sshd_config && \
17-
sed "0,/^Port 22/s//Port ${SSH_PORT}/" ${STAGE_DIR}/sshd_config > /etc/ssh/sshd_config && \
18-
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
19-
EXPOSE ${SSH_PORT}
20-
21-
#Set SSH KEY
22-
RUN mkdir /root/.ssh
23-
RUN printf "#StrictHostKeyChecking no\n#UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config && \
24-
ssh-keygen -t rsa -f /root/.ssh/id_rsa -N "" && cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && \
25-
chmod og-wx /root/.ssh/authorized_keys
26-
27-
RUN echo $'Host 127.0.0.1 \n\
28-
Hostname 127.0.0.1 \n\
29-
Port 6001 \n\
30-
StrictHostKeyChecking no \n\
31-
User root' > /root/.ssh/config
32-
RUN echo $'Host localhost \n\
33-
Hostname localhost \n\
34-
Port 6001 \n\
35-
StrictHostKeyChecking no \n\
36-
User root' >> /root/.ssh/config
37-
38-
RUN echo "service ssh start" >> /root/.bashrc
39-
40-
#Main deps
41-
RUN pip install tensorboard
42-
RUN pip install sentencepiece
43-
RUN pip install boto3
44-
RUN pip install jieba
45-
RUN pip install ftfy
46-
RUN pip install deepspeed==0.7.7
47-
RUN pip install bmtrain
48-
49-
RUN pip install flagai
50-
#For development usage, you can change as follows
51-
#RUN git clone https://github.com/FlagAI-Open/FlagAI.git && cd FlagAI && python setup.py install
1+
FROM nvcr.io/nvidia/cuda:11.7.0-devel-ubuntu20.04
2+
3+
LABEL zhanglu0704
4+
5+
ENV TZ=Asia/Shanghai
6+
7+
VOLUME /etc/localtime
8+
9+
ENV WORK_DID=/workspace
10+
11+
WORKDIR ${WORK_DID}
12+
13+
RUN apt update && \
14+
apt install -y g++ gcc cmake curl wget vim unzip git openssh-server net-tools python3-packaging && \
15+
apt install -y python3.9 python3.9-dev python3-pip && \
16+
apt clean -y && \
17+
rm -rf /var/cache/apt/archives
18+
19+
RUN rm /usr/bin/python3 && \
20+
ln -s /usr/bin/python3.9 /usr/bin/python3 && \
21+
ln -s /usr/bin/python3 /usr/bin/python && \
22+
python -m pip install --upgrade pip
23+
24+
RUN pip install torch==1.13.0+cu117 torchvision==0.14.0+cu117 torchaudio==0.13.0 \
25+
--extra-index-url https://download.pytorch.org/whl/cu117
26+
27+
COPY requirements.txt ${WORK_DID}/
28+
29+
RUN python -m pip install -r ${WORK_DID}/requirements.txt
30+
31+
RUN git clone https://github.com/NVIDIA/apex && \
32+
cd apex && \
33+
# git checkout -f 23.05 && \
34+
# pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" . && \
35+
pip install -v --disable-pip-version-check --no-cache-dir --no-build-isolation --config-settings "--build-option=--cpp_ext" --config-settings "--build-option=--cuda_ext" . && \
36+
cd ../ && rm -rf apex
37+
38+
RUN git clone https://github.com/OpenBMB/BMTrain && \
39+
cd BMTrain && \
40+
git checkout -f 0.2.2 && \
41+
# python setup.py install --prefix=/usr/local/
42+
pip install -v . && \
43+
cd ../ && rm -rf BMTrain
44+
45+
RUN git clone https://github.com/FlagAI-Open/FlagAI.git && \
46+
cd FlagAI && \
47+
pip install -v . && \
48+
cd ../ && rm -rf FlagAI
49+
50+
RUN echo "ClientAliveInterval 30" >> /etc/ssh/sshd_config && \
51+
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config && \
52+
echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config && \
53+
echo "UserKnownHostsFile /dev/null" >> /etc/ssh/ssh_config
54+
55+
RUN ssh-keygen -t rsa -f /root/.ssh/id_rsa -N "" && \
56+
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys && \
57+
chmod og-wx /root/.ssh/authorized_keys
5258

5359
CMD service ssh start && tail -f /dev/null
60+
61+
# sudo docker build -f Dockerfile --shm-size='120g' -t flagai:dev-ubuntu20-cuda11.7-py39 .

0 commit comments

Comments
 (0)