Spaces:
Runtime error
Runtime error
fix dockerfile
Browse files- docs/Dockerfile+ChatGLM +11 -11
docs/Dockerfile+ChatGLM
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
# How to build | 如何构建: docker build -t gpt-academic --network=host -f Dockerfile+ChatGLM .
|
2 |
-
# How to run | 如何运行 (1)
|
3 |
-
# How to run | 如何运行 (2) 我想运行之前进容器做一些调整: docker run --rm -it --net=host --gpus=
|
4 |
|
5 |
# 从NVIDIA源,从而支持显卡运损(检查宿主的nvidia-smi中的cuda版本必须>=11.3)
|
6 |
FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04
|
@@ -11,11 +11,11 @@ RUN apt-get install -y git python python3 python-dev python3-dev --fix-missing
|
|
11 |
|
12 |
# 配置代理网络(构建Docker镜像时使用)
|
13 |
# # comment out below if you do not need proxy network | 如果不需要翻墙 - 从此行向下删除
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
# # comment out above if you do not need proxy network | 如果不需要翻墙 - 从此行向上删除
|
20 |
|
21 |
|
@@ -24,7 +24,7 @@ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8
|
|
24 |
|
25 |
# 下载分支
|
26 |
WORKDIR /gpt
|
27 |
-
RUN $useProxyNetwork git clone https://github.com/binary-husky/chatgpt_academic.git
|
28 |
WORKDIR /gpt/chatgpt_academic
|
29 |
RUN $useProxyNetwork python3 -m pip install -r requirements.txt
|
30 |
RUN $useProxyNetwork python3 -m pip install -r request_llm/requirements_chatglm.txt
|
@@ -45,14 +45,14 @@ RUN $useProxyNetwork git pull
|
|
45 |
RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
|
46 |
|
47 |
# 为chatgpt-academic配置代理和API-KEY (非必要 可选步骤)
|
48 |
-
# 可同时填写多个API-KEY,支持openai的key和api2d的key共存,用英文逗号分割,例如API_KEY = "sk-openaikey1,
|
49 |
# LLM_MODEL 是选择初始的模型
|
50 |
# LOCAL_MODEL_DEVICE 是选择chatglm等本地模型运行的设备,可选 cpu 和 cuda
|
51 |
RUN echo ' \n\
|
52 |
-
API_KEY = "sk-
|
53 |
USE_PROXY = True \n\
|
54 |
LLM_MODEL = "chatglm" \n\
|
55 |
-
LOCAL_MODEL_DEVICE = "
|
56 |
proxies = { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } ' >> config_private.py
|
57 |
|
58 |
# 启动
|
|
|
1 |
# How to build | 如何构建: docker build -t gpt-academic --network=host -f Dockerfile+ChatGLM .
|
2 |
+
# How to run | 如何运行 (1) 直接运行(选择0号GPU): docker run --rm -it --net=host --gpus="0" gpt-academic
|
3 |
+
# How to run | 如何运行 (2) 我想运行之前进容器做一些调整: docker run --rm -it --net=host --gpus="0" gpt-academic bash
|
4 |
|
5 |
# 从NVIDIA源,从而支持显卡运损(检查宿主的nvidia-smi中的cuda版本必须>=11.3)
|
6 |
FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04
|
|
|
11 |
|
12 |
# 配置代理网络(构建Docker镜像时使用)
|
13 |
# # comment out below if you do not need proxy network | 如果不需要翻墙 - 从此行向下删除
|
14 |
+
RUN $useProxyNetwork curl cip.cc
|
15 |
+
RUN sed -i '$ d' /etc/proxychains.conf
|
16 |
+
RUN sed -i '$ d' /etc/proxychains.conf
|
17 |
+
RUN echo "socks5 127.0.0.1 10880" >> /etc/proxychains.conf
|
18 |
+
ARG useProxyNetwork=proxychains
|
19 |
# # comment out above if you do not need proxy network | 如果不需要翻墙 - 从此行向上删除
|
20 |
|
21 |
|
|
|
24 |
|
25 |
# 下载分支
|
26 |
WORKDIR /gpt
|
27 |
+
RUN $useProxyNetwork git clone https://github.com/binary-husky/chatgpt_academic.git
|
28 |
WORKDIR /gpt/chatgpt_academic
|
29 |
RUN $useProxyNetwork python3 -m pip install -r requirements.txt
|
30 |
RUN $useProxyNetwork python3 -m pip install -r request_llm/requirements_chatglm.txt
|
|
|
45 |
RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
|
46 |
|
47 |
# 为chatgpt-academic配置代理和API-KEY (非必要 可选步骤)
|
48 |
+
# 可同时填写多个API-KEY,支持openai的key和api2d的key共存,用英文逗号分割,例如API_KEY = "sk-openaikey1,fkxxxx-api2dkey2,........"
|
49 |
# LLM_MODEL 是选择初始的模型
|
50 |
# LOCAL_MODEL_DEVICE 是选择chatglm等本地模型运行的设备,可选 cpu 和 cuda
|
51 |
RUN echo ' \n\
|
52 |
+
API_KEY = "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \n\
|
53 |
USE_PROXY = True \n\
|
54 |
LLM_MODEL = "chatglm" \n\
|
55 |
+
LOCAL_MODEL_DEVICE = "cuda" \n\
|
56 |
proxies = { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } ' >> config_private.py
|
57 |
|
58 |
# 启动
|