Your Name commited on
Commit
966af4d
1 Parent(s): df1d4fa

warm up module in dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. docs/Dockerfile+ChatGLM +3 -0
Dockerfile CHANGED
@@ -14,4 +14,7 @@ RUN pip3 install -r requirements.txt
14
 
15
  COPY . .
16
 
 
 
 
17
  CMD ["python3", "-u", "main.py"]
 
14
 
15
  COPY . .
16
 
17
+ # 可选步骤,用于预热模块
18
+ RUN python3 -c 'from check_proxy import warm_up_modules; warm_up_modules()'
19
+
20
  CMD ["python3", "-u", "main.py"]
docs/Dockerfile+ChatGLM CHANGED
@@ -41,6 +41,9 @@ RUN python3 -u warm_up_chatglm.py
41
  ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
42
  RUN $useProxyNetwork git pull
43
 
 
 
 
44
  # 为chatgpt-academic配置代理和API-KEY (非必要 可选步骤)
45
  # 可同时填写多个API-KEY,支持openai的key和api2d的key共存,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey1,fkxxxx-api2dkey2"
46
  # LLM_MODEL 是选择初始的模型
 
41
  ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache
42
  RUN $useProxyNetwork git pull
43
 
44
+ # 预热Tiktoken模块
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,sk-openaikey2,fkxxxx-api2dkey1,fkxxxx-api2dkey2"
49
  # LLM_MODEL 是选择初始的模型