Team Ai
Apppublic

gordonchan/gpt-analysisi-code

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes
docker-compose.yml233 linesDownload Raw Back to root
1## ===================================================2# docker-compose.yml3## ===================================================4# 1. 请在以下方案中选择任意一种,然后删除其他的方案5# 2. 修改你选择的方案中的environment环境变量,详情请见github wiki或者config.py6# 3. 选择一种暴露服务端口的方法,并对相应的配置做出修改:7    # 【方法1: 适用于Linux,很方便,可惜windows不支持】与宿主的网络融合为一体,这个是默认配置8    # network_mode: "host"9    # 【方法2: 适用于所有系统包括Windows和MacOS】端口映射,把容器的端口映射到宿主的端口(注意您需要先删除network_mode: "host",再追加以下内容)10    # ports:11    #   - "12345:12345"  # 注意!12345必须与WEB_PORT环境变量相互对应12# 4. 最后`docker-compose up`运行13# 5. 如果希望使用显卡,请关注 LOCAL_MODEL_DEVICE 和 英伟达显卡运行时 选项14## ===================================================15# 1. Please choose one of the following options and delete the others.16# 2. Modify the environment variables in the selected option, see GitHub wiki or config.py for more details.17# 3. Choose a method to expose the server port and make the corresponding configuration changes:18    # [Method 1: Suitable for Linux, convenient, but not supported for Windows] Fusion with the host network, this is the default configuration19    # network_mode: "host"20    # [Method 2: Suitable for all systems including Windows and MacOS] Port mapping, mapping the container port to the host port (note that you need to delete network_mode: "host" first, and then add the following content)21    # ports:22    # - "12345: 12345" # Note! 12345 must correspond to the WEB_PORT environment variable.23# 4. Finally, run `docker-compose up`.24# 5. If you want to use a graphics card, pay attention to the LOCAL_MODEL_DEVICE and Nvidia GPU runtime options.25## ===================================================26 27## ===================================================28## 【方案零】 部署项目的全部能力(这个是包含cuda和latex的大型镜像。如果您网速慢、硬盘小或没有显卡,则不推荐使用这个)29## ===================================================30version: '3'31services:32  gpt_academic_full_capability:33    image: ghcr.io/binary-husky/gpt_academic_with_all_capacity:master34    environment:35      # 请查阅 `config.py`或者 github wiki 以查看所有的配置信息36      API_KEY:                  '  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                        '37      # USE_PROXY:                '  True                                                                       '38      # proxies:                  '  { "http": "http://localhost:10881", "https": "http://localhost:10881", }   '39      LLM_MODEL:                '  gpt-3.5-turbo                                                              '40      AVAIL_LLM_MODELS:         '  ["gpt-3.5-turbo", "gpt-4", "qianfan", "sparkv2", "spark", "chatglm"]       '41      BAIDU_CLOUD_API_KEY :     '  bTUtwEAveBrQipEowUvDwYWq                                                   '42      BAIDU_CLOUD_SECRET_KEY :  '  jqXtLvXiVw6UNdjliATTS61rllG8Iuni                                           '43      XFYUN_APPID:              '  53a8d816                                                                   '44      XFYUN_API_SECRET:         '  MjMxNDQ4NDE4MzM0OSNlNjQ2NTlhMTkx                                           '45      XFYUN_API_KEY:            '  95ccdec285364869d17b33e75ee96447                                           '46      ENABLE_AUDIO:             '  False                                                                      '47      DEFAULT_WORKER_NUM:       '  20                                                                         '48      WEB_PORT:                 '  12345                                                                      '49      ADD_WAIFU:                '  False                                                                      '50      ALIYUN_APPKEY:            '  RxPlZrM88DnAFkZK                                                           '51      THEME:                    '  Chuanhu-Small-and-Beautiful                                                '52      ALIYUN_ACCESSKEY:         '  LTAI5t6BrFUzxRXVGUWnekh1                                                   '53      ALIYUN_SECRET:            '  eHmI20SVWIwQZxCiTD2bGQVspP9i68                                             '54      # LOCAL_MODEL_DEVICE:       '  cuda                                                                       '55 56    # 加载英伟达显卡运行时57    # runtime: nvidia58    # deploy:59    #     resources:60    #       reservations:61    #         devices:62    #           - driver: nvidia63    #             count: 164    #             capabilities: [gpu]65 66    # 【WEB_PORT暴露方法1: 适用于Linux】与宿主的网络融合67    network_mode: "host"68 69    # 【WEB_PORT暴露方法2: 适用于所有系统】端口映射70    # ports:71    #   - "12345:12345"  # 12345必须与WEB_PORT相互对应72 73    # 启动容器后,运行main.py主程序74    command: >75      bash -c "python3 -u main.py"76 77 78 79 80## ===================================================81## 【方案一】 如果不需要运行本地模型(仅 chatgpt, azure, 星火, 千帆, claude 等在线大模型服务)82## ===================================================83version: '3'84services:85  gpt_academic_nolocalllms:86    image: ghcr.io/binary-husky/gpt_academic_nolocal:master # (Auto Built by Dockerfile: docs/GithubAction+NoLocal)87    environment:88      # 请查阅 `config.py` 以查看所有的配置信息89      API_KEY:                  '    sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                                            '90      USE_PROXY:                '    True                                                                                           '91      proxies:                  '    { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", }                 '92      LLM_MODEL:                '    gpt-3.5-turbo                                                                                  '93      AVAIL_LLM_MODELS:         '    ["gpt-3.5-turbo", "api2d-gpt-3.5-turbo", "gpt-4", "api2d-gpt-4", "sparkv2", "qianfan"]         '94      WEB_PORT:                 '    22303                                                                                          '95      ADD_WAIFU:                '    True                                                                                           '96      # THEME:                    '    Chuanhu-Small-and-Beautiful                                                                    '97      # DEFAULT_WORKER_NUM:       '    10                                                                                             '98      # AUTHENTICATION:           '    [("username", "passwd"), ("username2", "passwd2")]                                             '99 100    # 与宿主的网络融合101    network_mode: "host"102 103    # 不使用代理网络拉取最新代码104    command: >105      bash -c "python3 -u main.py"106 107 108### ===================================================109### 【方案二】 如果需要运行ChatGLM + Qwen + MOSS等本地模型110### ===================================================111version: '3'112services:113  gpt_academic_with_chatglm:114    image: ghcr.io/binary-husky/gpt_academic_chatglm_moss:master  # (Auto Built by Dockerfile: docs/Dockerfile+ChatGLM)115    environment:116      # 请查阅 `config.py` 以查看所有的配置信息117      API_KEY:                  '    sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                                            '118      USE_PROXY:                '    True                                                                                           '119      proxies:                  '    { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", }                 '120      LLM_MODEL:                '    gpt-3.5-turbo                                                                                  '121      AVAIL_LLM_MODELS:         '    ["chatglm", "qwen", "moss", "gpt-3.5-turbo", "gpt-4", "newbing"]                               '122      LOCAL_MODEL_DEVICE:       '    cuda                                                                                           '123      DEFAULT_WORKER_NUM:       '    10                                                                                             '124      WEB_PORT:                 '    12303                                                                                          '125      ADD_WAIFU:                '    True                                                                                           '126      # AUTHENTICATION:           '    [("username", "passwd"), ("username2", "passwd2")]                                             '127 128    # 显卡的使用,nvidia0指第0个GPU129    runtime: nvidia130    devices:131      - /dev/nvidia0:/dev/nvidia0132      133    # 与宿主的网络融合134    network_mode: "host"135    command: >136      bash -c "python3 -u main.py"137 138    # P.S. 通过对 command 进行微调,可以便捷地安装额外的依赖139    # command: >140    #   bash -c "pip install -r request_llms/requirements_qwen.txt && python3 -u main.py"141 142### ===================================================143### 【方案三】 如果需要运行ChatGPT + LLAMA + 盘古 + RWKV本地模型144### ===================================================145version: '3'146services:147  gpt_academic_with_rwkv:148    image: ghcr.io/binary-husky/gpt_academic_jittorllms:master149    environment:150      # 请查阅 `config.py` 以查看所有的配置信息151      API_KEY:                  '    sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,fkxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  '152      USE_PROXY:                '    True                                                                                           '153      proxies:                  '    { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", }                 '154      LLM_MODEL:                '    gpt-3.5-turbo                                                                                  '155      AVAIL_LLM_MODELS:         '    ["gpt-3.5-turbo", "newbing", "jittorllms_rwkv", "jittorllms_pangualpha", "jittorllms_llama"]   '156      LOCAL_MODEL_DEVICE:       '    cuda                                                                                           '157      DEFAULT_WORKER_NUM:       '    10                                                                                             '158      WEB_PORT:                 '    12305                                                                                          '159      ADD_WAIFU:                '    True                                                                                           '160      # AUTHENTICATION:           '    [("username", "passwd"), ("username2", "passwd2")]                                             '161 162    # 显卡的使用,nvidia0指第0个GPU163    runtime: nvidia164    devices:165      - /dev/nvidia0:/dev/nvidia0166      167    # 与宿主的网络融合168    network_mode: "host"169 170    # 不使用代理网络拉取最新代码171    command: >172      python3 -u main.py173 174 175## ===================================================176## 【方案四】 ChatGPT + Latex177## ===================================================178version: '3'179services:180  gpt_academic_with_latex:181    image: ghcr.io/binary-husky/gpt_academic_with_latex:master  # (Auto Built by Dockerfile: docs/GithubAction+NoLocal+Latex)182    environment:183      # 请查阅 `config.py` 以查看所有的配置信息184      API_KEY:                  '    sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx                              '185      USE_PROXY:                '    True                                                                             '186      proxies:                  '    { "http": "socks5h://localhost:10880", "https": "socks5h://localhost:10880", }   '187      LLM_MODEL:                '    gpt-3.5-turbo                                                                    '188      AVAIL_LLM_MODELS:         '    ["gpt-3.5-turbo", "gpt-4"]                                                       '189      LOCAL_MODEL_DEVICE:       '    cuda                                                                             '190      DEFAULT_WORKER_NUM:       '    10                                                                               '191      WEB_PORT:                 '    12303                                                                            '192 193    # 与宿主的网络融合194    network_mode: "host"195 196    # 不使用代理网络拉取最新代码197    command: >198      bash -c "python3 -u main.py"199 200 201## ===================================================202## 【方案五】 ChatGPT + 语音助手 (请先阅读 docs/use_audio.md)203## ===================================================204version: '3'205services:206  gpt_academic_with_audio:207    image: ghcr.io/binary-husky/gpt_academic_audio_assistant:master208    environment:209      # 请查阅 `config.py` 以查看所有的配置信息210      API_KEY:                  '    fk195831-IdP0Pb3W6DCMUIbQwVX6MsSiyxwqybyS                        '211      USE_PROXY:                '    False                                                            '212      proxies:                  '    None                                                             '213      LLM_MODEL:                '    gpt-3.5-turbo                                                    '214      AVAIL_LLM_MODELS:         '    ["gpt-3.5-turbo", "gpt-4"]                                       '215      ENABLE_AUDIO:             '    True                                                             '216      LOCAL_MODEL_DEVICE:       '    cuda                                                             '217      DEFAULT_WORKER_NUM:       '    20                                                               '218      WEB_PORT:                 '    12343                                                            '219      ADD_WAIFU:                '    True                                                             '220      THEME:                    '    Chuanhu-Small-and-Beautiful                                      '221      ALIYUN_APPKEY:            '    RoP1ZrM84DnAFkZK                                                 '222      ALIYUN_TOKEN:             '    f37f30e0f9934c34a992f6f64f7eba4f                                 '223      # (无需填写) ALIYUN_ACCESSKEY:         '    LTAI5q6BrFUzoRXVGUWnekh1                                         '224      # (无需填写) ALIYUN_SECRET:            '    eHmI20AVWIaQZ0CiTD2bGQVsaP9i68                                   '225 226    # 与宿主的网络融合227    network_mode: "host"228 229    # 不使用代理网络拉取最新代码230    command: >231      bash -c "python3 -u main.py"232 233