-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
107 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages | ||
name: build-with-all-capacity-beta | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}_with_all_capacity_beta | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
file: docs/GithubAction+AllCapacityBeta | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# docker build -t gpt-academic-all-capacity -f docs/GithubAction+AllCapacity --network=host --build-arg http_proxy=http://localhost:10881 --build-arg https_proxy=http://localhost:10881 . | ||
# docker build -t gpt-academic-all-capacity -f docs/GithubAction+AllCapacityBeta --network=host . | ||
# docker run -it --net=host gpt-academic-all-capacity bash | ||
|
||
# 从NVIDIA源,从而支持显卡(检查宿主的nvidia-smi中的cuda版本必须>=11.3) | ||
FROM fuqingxu/11.3.1-runtime-ubuntu20.04-with-texlive:latest | ||
|
||
# use python3 as the system default python | ||
WORKDIR /gpt | ||
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8 | ||
|
||
# # 非必要步骤,更换pip源 (以下三行,可以删除) | ||
# RUN echo '[global]' > /etc/pip.conf && \ | ||
# echo 'index-url = https://mirrors.aliyun.com/pypi/simple/' >> /etc/pip.conf && \ | ||
# echo 'trusted-host = mirrors.aliyun.com' >> /etc/pip.conf | ||
|
||
# 下载pytorch | ||
RUN python3 -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113 | ||
# 准备pip依赖 | ||
RUN python3 -m pip install openai numpy arxiv rich | ||
RUN python3 -m pip install colorama Markdown pygments pymupdf | ||
RUN python3 -m pip install python-docx moviepy pdfminer | ||
RUN python3 -m pip install zh_langchain==0.2.1 pypinyin | ||
RUN python3 -m pip install rarfile py7zr | ||
RUN python3 -m pip install aliyun-python-sdk-core==2.13.3 pyOpenSSL webrtcvad scipy git+https://github.com/aliyun/alibabacloud-nls-python-sdk.git | ||
# 下载分支 | ||
WORKDIR /gpt | ||
RUN git clone --depth=1 https://github.com/binary-husky/gpt_academic.git | ||
WORKDIR /gpt/gpt_academic | ||
RUN git clone --depth=1 https://github.com/OpenLMLab/MOSS.git request_llms/moss | ||
|
||
RUN python3 -m pip install -r requirements.txt | ||
RUN python3 -m pip install -r request_llms/requirements_moss.txt | ||
RUN python3 -m pip install -r request_llms/requirements_qwen.txt | ||
RUN python3 -m pip install -r request_llms/requirements_chatglm.txt | ||
RUN python3 -m pip install -r request_llms/requirements_newbing.txt | ||
RUN python3 -m pip install nougat-ocr | ||
|
||
# 预热Tiktoken模块 | ||
RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()' | ||
|
||
# 安装知识库插件的额外依赖 | ||
RUN apt-get update && apt-get install libgl1 -y | ||
RUN pip3 install transformers protobuf langchain sentence-transformers faiss-cpu nltk beautifulsoup4 bitsandbytes tabulate icetk --upgrade | ||
RUN pip3 install unstructured[all-docs] --upgrade | ||
RUN python3 -c 'from check_proxy import warm_up_vectordb; warm_up_vectordb()' | ||
RUN rm -rf /usr/local/lib/python3.8/dist-packages/tests | ||
|
||
|
||
# COPY .cache /root/.cache | ||
# COPY config_private.py config_private.py | ||
# 启动 | ||
CMD ["python3", "-u", "main.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,3 @@ sentencepiece | |
numpy | ||
onnxruntime | ||
sentencepiece | ||
streamlit | ||
streamlit-chat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,4 @@ accelerate | |
matplotlib | ||
huggingface_hub | ||
triton | ||
streamlit | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters