qingxu99 commited on
Commit
7875741
1 Parent(s): 9b8e7e9

upload docker compose

Browse files
Files changed (1) hide show
  1. docker-compose.yml +75 -0
docker-compose.yml ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ## 请在以下方案中选择一种,然后删除其他的方案,最后docker-compose up运行
3
+
4
+ ## ===================================================
5
+ ## 【方案一】 如果不需要运行本地模型(仅chatgpt类远程服务)
6
+ ## ===================================================
7
+ version: '3'
8
+ services:
9
+ gpt_academic_nolocalllms:
10
+ image: fuqingxu/gpt_academic:no-local-llms
11
+ environment:
12
+ # 请查阅 `config.py` 以查看所有的配置信息
13
+ API_KEY: ' sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '
14
+ USE_PROXY: ' True '
15
+ proxies: ' { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } '
16
+ LLM_MODEL: ' gpt-3.5-turbo '
17
+ AVAIL_LLM_MODELS: ' ["gpt-3.5-turbo", "api2d-gpt-4"] '
18
+ DEFAULT_WORKER_NUM: ' 10 '
19
+ WEB_PORT: ' 22303 '
20
+ ADD_WAIFU: ' True '
21
+ AUTHENTICATION: ' [("username", "passwd"), ("username2", "passwd2")] '
22
+
23
+ # 与宿主的网络融合
24
+ network_mode: "host"
25
+
26
+ # 不使用代理网络拉取最新代码
27
+ command: >
28
+ bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
29
+ git checkout master --force &&
30
+ git remote set-url origin https://github.com/binary-husky/chatgpt_academic.git &&
31
+ git pull &&
32
+ python3 -u main.py"
33
+
34
+
35
+ ### ===================================================
36
+ ### 【方案二】 如果需要运行ChatGLM本地模型
37
+ ### ===================================================
38
+ version: '3'
39
+ services:
40
+ gpt_academic_with_chatglm:
41
+ image: fuqingxu/gpt_academic:chatgpt-chatglm-newbing # [option 2] 如果需要运行ChatGLM本地模型
42
+ environment:
43
+ # 请查阅 `config.py` 以查看所有的配置信息
44
+ API_KEY: ' sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx '
45
+ USE_PROXY: ' True '
46
+ proxies: ' { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", } '
47
+ LLM_MODEL: ' gpt-3.5-turbo '
48
+ AVAIL_LLM_MODELS: ' ["gpt-3.5-turbo", "api2d-gpt-4", "chatglm"] '
49
+ LOCAL_MODEL_DEVICE: ' cuda '
50
+ DEFAULT_WORKER_NUM: ' 10 '
51
+ WEB_PORT: ' 12303 '
52
+ ADD_WAIFU: ' True '
53
+ AUTHENTICATION: ' [("username", "passwd"), ("username2", "passwd2")] '
54
+
55
+ # 显卡的使用,nvidia0指第0个GPU
56
+ runtime: nvidia
57
+ devices:
58
+ - /dev/nvidia0:/dev/nvidia0
59
+
60
+ # 与宿主的网络融合
61
+ network_mode: "host"
62
+
63
+ # 使用代理网络拉取最新代码
64
+ # command: >
65
+ # bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
66
+ # truncate -s -1 /etc/proxychains.conf &&
67
+ # echo \"socks5 127.0.0.1 10880\" >> /etc/proxychains.conf &&
68
+ # proxychains git pull &&
69
+ # python3 -u main.py "
70
+
71
+ # 不使用代理网络拉取最新代码
72
+ command: >
73
+ bash -c " echo '[gpt-academic] 正在从github拉取最新代码...' &&
74
+ git pull &&
75
+ python3 -u main.py"