GithubAction+JittorLLMs 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. # 从NVIDIA源,从而支持显卡运损(检查宿主的nvidia-smi中的cuda版本必须>=11.3)
  2. FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04
  3. ARG useProxyNetwork=''
  4. RUN apt-get update
  5. RUN apt-get install -y curl proxychains curl g++
  6. RUN apt-get install -y git python python3 python-dev python3-dev --fix-missing
  7. # use python3 as the system default python
  8. RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8
  9. # 下载pytorch
  10. RUN python3 -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
  11. # 下载分支
  12. WORKDIR /gpt
  13. RUN git clone --depth=1 https://github.com/binary-husky/gpt_academic.git
  14. WORKDIR /gpt/gpt_academic
  15. RUN python3 -m pip install -r requirements.txt
  16. RUN python3 -m pip install -r request_llms/requirements_chatglm.txt
  17. RUN python3 -m pip install -r request_llms/requirements_newbing.txt
  18. RUN python3 -m pip install -r request_llms/requirements_jittorllms.txt -i https://pypi.jittor.org/simple -I
  19. # 下载JittorLLMs
  20. RUN git clone https://github.com/binary-husky/JittorLLMs.git --depth 1 request_llms/jittorllms
  21. # 禁用缓存,确保更新代码
  22. ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
  23. RUN git pull
  24. # 预热Tiktoken模块
  25. RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
  26. # 启动
  27. CMD ["python3", "-u", "main.py"]