Spaces:
Running
Running
add huggingface conf
Browse files- Dockerfile +2 -0
- config_private.py +384 -0
Dockerfile
CHANGED
|
@@ -9,6 +9,8 @@ WORKDIR /gpt
|
|
| 9 |
|
| 10 |
RUN git clone https://github.com/binary-husky/gpt_academic.git
|
| 11 |
|
|
|
|
|
|
|
| 12 |
WORKDIR /gpt/gpt_academic
|
| 13 |
|
| 14 |
# 装载项目文件,安装剩余依赖(必要)
|
|
|
|
| 9 |
|
| 10 |
RUN git clone https://github.com/binary-husky/gpt_academic.git
|
| 11 |
|
| 12 |
+
COPY ./config_private.py /gpt/gpt_academic/config_private.py
|
| 13 |
+
|
| 14 |
WORKDIR /gpt/gpt_academic
|
| 15 |
|
| 16 |
# 装载项目文件,安装剩余依赖(必要)
|
config_private.py
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
以下所有配置也都支持利用环境变量覆写,环境变量配置格式见docker-compose.yml。
|
| 3 |
+
读取优先级:环境变量 > config_private.py > config.py
|
| 4 |
+
--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
|
| 5 |
+
All the following configurations also support using environment variables to override,
|
| 6 |
+
and the environment variable configuration format can be seen in docker-compose.yml.
|
| 7 |
+
Configuration reading priority: environment variable > config_private.py > config.py
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
# [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项
|
| 11 |
+
API_KEY = "此处填API密钥" # 可同时填写多个API-KEY,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey3,azure-apikey4"
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
# [step 2]>> 改为True应用代理,如果直接在海外服务器部署,此处不修改;如果使用本地或无地域限制的大模型时,此处也不需要修改
|
| 15 |
+
USE_PROXY = False
|
| 16 |
+
if USE_PROXY:
|
| 17 |
+
"""
|
| 18 |
+
代理网络的地址,打开你的代理软件查看代理协议(socks5h / http)、地址(localhost)和端口(11284)
|
| 19 |
+
填写格式是 [协议]:// [地址] :[端口],填写之前不要忘记把USE_PROXY改成True,如果直接在海外服务器部署,此处不修改
|
| 20 |
+
<配置教程&视频教程> https://github.com/binary-husky/gpt_academic/issues/1>
|
| 21 |
+
[协议] 常见协议无非socks5h/http; 例如 v2**y 和 ss* 的默认本地协议是socks5h; 而cl**h 的默认本地协议是http
|
| 22 |
+
[地址] 填localhost或者127.0.0.1(localhost意思是代理软件安装在本机上)
|
| 23 |
+
[端口] 在代理软件的设置里找。虽然不同的代理软件界面不一样,但端口号都应该在最显眼的位置上
|
| 24 |
+
"""
|
| 25 |
+
proxies = {
|
| 26 |
+
# [协议]:// [地址] :[端口]
|
| 27 |
+
"http": "socks5h://localhost:11284", # 再例如 "http": "http://127.0.0.1:7890",
|
| 28 |
+
"https": "socks5h://localhost:11284", # 再例如 "https": "http://127.0.0.1:7890",
|
| 29 |
+
}
|
| 30 |
+
else:
|
| 31 |
+
proxies = None
|
| 32 |
+
|
| 33 |
+
# [step 3]>> 模型选择是 (注意: LLM_MODEL是默认选中的模型, 它*必须*被包含在AVAIL_LLM_MODELS列表中 )
|
| 34 |
+
LLM_MODEL = "gpt-3.5-turbo-16k" # 可选 ↓↓↓
|
| 35 |
+
AVAIL_LLM_MODELS = ["gpt-4-1106-preview", "gpt-4-turbo-preview", "gpt-4-vision-preview",
|
| 36 |
+
"gpt-3.5-turbo-1106", "gpt-3.5-turbo-16k", "gpt-3.5-turbo", "azure-gpt-3.5",
|
| 37 |
+
"gpt-4", "gpt-4-32k", "azure-gpt-4", "glm-4", "glm-3-turbo",
|
| 38 |
+
"gemini-pro", "chatglm3", "claude-2"]
|
| 39 |
+
# --- --- --- ---
|
| 40 |
+
# P.S. 其他可用的模型还包括
|
| 41 |
+
# AVAIL_LLM_MODELS = [
|
| 42 |
+
# "qianfan", "deepseekcoder",
|
| 43 |
+
# "spark", "sparkv2", "sparkv3", "sparkv3.5",
|
| 44 |
+
# "qwen-turbo", "qwen-plus", "qwen-max", "qwen-local",
|
| 45 |
+
# "moonshot-v1-128k", "moonshot-v1-32k", "moonshot-v1-8k",
|
| 46 |
+
# "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-0125"
|
| 47 |
+
# "claude-3-haiku-20240307","claude-3-sonnet-20240229","claude-3-opus-20240229", "claude-2.1", "claude-instant-1.2",
|
| 48 |
+
# "moss", "llama2", "chatglm_onnx", "internlm", "jittorllms_pangualpha", "jittorllms_llama",
|
| 49 |
+
# "yi-34b-chat-0205", "yi-34b-chat-200k"
|
| 50 |
+
# ]
|
| 51 |
+
# --- --- --- ---
|
| 52 |
+
# 此外,为了更灵活地接入one-api多模型管理界面,您还可以在接入one-api时,
|
| 53 |
+
# 使用"one-api-*"前缀直接使用非标准方式接入的模型,例如
|
| 54 |
+
# AVAIL_LLM_MODELS = ["one-api-claude-3-sonnet-20240229(max_token=100000)"]
|
| 55 |
+
# --- --- --- ---
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
# --------------- 以下配置可以优化体验 ---------------
|
| 59 |
+
|
| 60 |
+
# 重新URL重新定向,实现更换API_URL的作用(高危设置! 常规情况下不要修改! 通过修改此设置,您将把您的API-KEY和对话隐私完全暴露给您设定的中间人!)
|
| 61 |
+
# 格式: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "在这里填写重定向的api.openai.com的URL"}
|
| 62 |
+
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions"}
|
| 63 |
+
API_URL_REDIRECT = {}
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
# 多线程函数插件中,默认允许多少路线程同时访问OpenAI。Free trial users的限制是每分钟3次,Pay-as-you-go users的限制是每分钟3500次
|
| 67 |
+
# 一言以蔽之:免费(5刀)用户填3,OpenAI绑了信用卡的用户可以填 16 或者更高。提高限制请查询:https://platform.openai.com/docs/guides/rate-limits/overview
|
| 68 |
+
DEFAULT_WORKER_NUM = 3
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
# 色彩主题, 可选 ["Default", "Chuanhu-Small-and-Beautiful", "High-Contrast"]
|
| 72 |
+
# 更多主题, 请查阅Gradio主题商店: https://huggingface.co/spaces/gradio/theme-gallery 可选 ["Gstaff/Xkcd", "NoCrypt/Miku", ...]
|
| 73 |
+
THEME = "Chuanhu-Small-and-Beautiful"
|
| 74 |
+
AVAIL_THEMES = ["Default", "Chuanhu-Small-and-Beautiful", "High-Contrast", "Gstaff/Xkcd", "NoCrypt/Miku"]
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
# 默认的系统提示词(system prompt)
|
| 78 |
+
INIT_SYS_PROMPT = "Serve me as a writing and programming assistant."
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
# 对话窗的高度 (���在LAYOUT="TOP-DOWN"时生效)
|
| 82 |
+
CHATBOT_HEIGHT = 1115
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
# 代码高亮
|
| 86 |
+
CODE_HIGHLIGHT = True
|
| 87 |
+
|
| 88 |
+
|
| 89 |
+
# 窗口布局
|
| 90 |
+
LAYOUT = "LEFT-RIGHT" # "LEFT-RIGHT"(左右布局) # "TOP-DOWN"(上下布局)
|
| 91 |
+
|
| 92 |
+
|
| 93 |
+
# 暗色模式 / 亮色模式
|
| 94 |
+
DARK_MODE = True
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
# 发送请求到OpenAI后,等待多久判定为超时
|
| 98 |
+
TIMEOUT_SECONDS = 30
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
# 网页的端口, -1代表随机端口
|
| 102 |
+
WEB_PORT = -1
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
# 如果OpenAI不响应(网络卡顿、代理失败、KEY失效),重试的次数限制
|
| 106 |
+
MAX_RETRY = 2
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
# 插件分类默认选项
|
| 110 |
+
DEFAULT_FN_GROUPS = ['对话', '编程', '学术', '智能体']
|
| 111 |
+
|
| 112 |
+
|
| 113 |
+
# 定义界面上“询问多个GPT模型”插件应该使用哪些模型,请从AVAIL_LLM_MODELS中选择,并在不同模型之间用`&`间隔,例如"gpt-3.5-turbo&chatglm3&azure-gpt-4"
|
| 114 |
+
MULTI_QUERY_LLM_MODELS = "gpt-3.5-turbo&chatglm3"
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
# 选择本地模型变体(只有当AVAIL_LLM_MODELS包含了对应本地模型时,才会起作用)
|
| 118 |
+
# 如果你选择Qwen系列的模型,那么请在下面的QWEN_MODEL_SELECTION中指定具体的模型
|
| 119 |
+
# 也可以是具体的模型路径
|
| 120 |
+
QWEN_LOCAL_MODEL_SELECTION = "Qwen/Qwen-1_8B-Chat-Int8"
|
| 121 |
+
|
| 122 |
+
|
| 123 |
+
# 接入通义千问在线大模型 https://dashscope.console.aliyun.com/
|
| 124 |
+
DASHSCOPE_API_KEY = "" # 阿里灵积云API_KEY
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
# 百度千帆(LLM_MODEL="qianfan")
|
| 128 |
+
BAIDU_CLOUD_API_KEY = ''
|
| 129 |
+
BAIDU_CLOUD_SECRET_KEY = ''
|
| 130 |
+
BAIDU_CLOUD_QIANFAN_MODEL = 'ERNIE-Bot' # 可选 "ERNIE-Bot-4"(文心大模型4.0), "ERNIE-Bot"(文心一言), "ERNIE-Bot-turbo", "BLOOMZ-7B", "Llama-2-70B-Chat", "Llama-2-13B-Chat", "Llama-2-7B-Chat"
|
| 131 |
+
|
| 132 |
+
|
| 133 |
+
# 如果使用ChatGLM2微调模型,请把 LLM_MODEL="chatglmft",并在此处指定模型路径
|
| 134 |
+
CHATGLM_PTUNING_CHECKPOINT = "" # 例如"/home/hmp/ChatGLM2-6B/ptuning/output/6b-pt-128-1e-2/checkpoint-100"
|
| 135 |
+
|
| 136 |
+
|
| 137 |
+
# 本地LLM模型如ChatGLM的执行方式 CPU/GPU
|
| 138 |
+
LOCAL_MODEL_DEVICE = "cpu" # 可选 "cuda"
|
| 139 |
+
LOCAL_MODEL_QUANT = "FP16" # 默认 "FP16" "INT4" 启用量化INT4版本 "INT8" 启用量化INT8版本
|
| 140 |
+
|
| 141 |
+
|
| 142 |
+
# 设置gradio的并行线程数(不需要修改)
|
| 143 |
+
CONCURRENT_COUNT = 100
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
# 是否在提交时自动清空输入框
|
| 147 |
+
AUTO_CLEAR_TXT = False
|
| 148 |
+
|
| 149 |
+
|
| 150 |
+
# 加一个live2d装饰
|
| 151 |
+
ADD_WAIFU = True
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
# 设置用户名和密码(不需要修改)(相关功能不稳定,与gradio版本和网络都相关,如果本地使用不建议加这个)
|
| 155 |
+
# [("username", "password"), ("username2", "password2"), ...]
|
| 156 |
+
AUTHENTICATION = []
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
# 如果需要在二级路径下运行(常规情况下,不要修改!!)
|
| 160 |
+
# (举例 CUSTOM_PATH = "/gpt_academic",可以让软件运行在 http://ip:port/gpt_academic/ 下。)
|
| 161 |
+
CUSTOM_PATH = "/"
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
# HTTPS 秘钥和证书(不需要修改)
|
| 165 |
+
SSL_KEYFILE = ""
|
| 166 |
+
SSL_CERTFILE = ""
|
| 167 |
+
|
| 168 |
+
|
| 169 |
+
# 极少数情况下,openai的官方KEY需要伴随组织编码(格式如org-xxxxxxxxxxxxxxxxxxxxxxxx)使用
|
| 170 |
+
API_ORG = ""
|
| 171 |
+
|
| 172 |
+
|
| 173 |
+
# 如果需要使用Slack Claude,使用教程详情见 request_llms/README.md
|
| 174 |
+
SLACK_CLAUDE_BOT_ID = ''
|
| 175 |
+
SLACK_CLAUDE_USER_TOKEN = ''
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
# 如果需要使用AZURE(方法一:单个azure模型部署)详情请见额外文档 docs\use_azure.md
|
| 179 |
+
AZURE_ENDPOINT = "https://你亲手写的api名称.openai.azure.com/"
|
| 180 |
+
AZURE_API_KEY = "填入azure openai api的密钥" # 建议直接在API_KEY处填写,该选项即将被弃用
|
| 181 |
+
AZURE_ENGINE = "填入你亲手写的部署名" # 读 docs\use_azure.md
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
# 如果需要使用AZURE(方法二:多个azure模型部署+动态切换)详情请见额外文档 docs\use_azure.md
|
| 185 |
+
AZURE_CFG_ARRAY = {}
|
| 186 |
+
|
| 187 |
+
|
| 188 |
+
# 阿里云实时语音识别 配置难度较高
|
| 189 |
+
# 参考 https://github.com/binary-husky/gpt_academic/blob/master/docs/use_audio.md
|
| 190 |
+
ENABLE_AUDIO = False
|
| 191 |
+
ALIYUN_TOKEN="" # 例如 f37f30e0f9934c34a992f6f64f7eba4f
|
| 192 |
+
ALIYUN_APPKEY="" # 例如 RoPlZrM88DnAFkZK
|
| 193 |
+
ALIYUN_ACCESSKEY="" # (无需填写)
|
| 194 |
+
ALIYUN_SECRET="" # (无需填写)
|
| 195 |
+
|
| 196 |
+
|
| 197 |
+
# 接入讯飞星火大模型 https://console.xfyun.cn/services/iat
|
| 198 |
+
XFYUN_APPID = "00000000"
|
| 199 |
+
XFYUN_API_SECRET = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
|
| 200 |
+
XFYUN_API_KEY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
# 接入智谱大模型
|
| 204 |
+
ZHIPUAI_API_KEY = ""
|
| 205 |
+
ZHIPUAI_MODEL = "" # 此选项已废弃,不再需要填写
|
| 206 |
+
|
| 207 |
+
|
| 208 |
+
# Claude API KEY
|
| 209 |
+
ANTHROPIC_API_KEY = ""
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
# 月之暗面 API KEY
|
| 213 |
+
MOONSHOT_API_KEY = ""
|
| 214 |
+
|
| 215 |
+
|
| 216 |
+
# 零一万物(Yi Model) API KEY
|
| 217 |
+
YIMODEL_API_KEY = ""
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
# Mathpix 拥有执行PDF的OCR功能,但是需要注册账号
|
| 221 |
+
MATHPIX_APPID = ""
|
| 222 |
+
MATHPIX_APPKEY = ""
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
# Mathpix 拥有执行PDF的OCR功能,但是需要注册账号
|
| 226 |
+
DOC2X_API_KEY = ""
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
# 自定义API KEY格式
|
| 230 |
+
CUSTOM_API_KEY_PATTERN = ""
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
# Google Gemini API-Key
|
| 234 |
+
GEMINI_API_KEY = ''
|
| 235 |
+
|
| 236 |
+
|
| 237 |
+
# HUGGINGFACE的TOKEN,下载LLAMA时起作用 https://huggingface.co/docs/hub/security-tokens
|
| 238 |
+
HUGGINGFACE_ACCESS_TOKEN = ""
|
| 239 |
+
|
| 240 |
+
|
| 241 |
+
# GROBID服务器地址(填写多个可以均衡负载),用于高质量地读取PDF文档
|
| 242 |
+
# 获取方法:复制以下空间https://huggingface.co/spaces/qingxu98/grobid,设为public,然后GROBID_URL = "https://(你的hf用户名如qingxu98)-(你的填写��空间名如grobid).hf.space"
|
| 243 |
+
GROBID_URLS = [
|
| 244 |
+
"https://qingxu98-grobid.hf.space","https://qingxu98-grobid2.hf.space","https://qingxu98-grobid3.hf.space",
|
| 245 |
+
"https://qingxu98-grobid4.hf.space","https://qingxu98-grobid5.hf.space", "https://qingxu98-grobid6.hf.space",
|
| 246 |
+
"https://qingxu98-grobid7.hf.space", "https://qingxu98-grobid8.hf.space",
|
| 247 |
+
]
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
# 是否允许通过自然语言描述修改本页的配置,该功能具有一定的危险性,默认关闭
|
| 251 |
+
ALLOW_RESET_CONFIG = False
|
| 252 |
+
|
| 253 |
+
|
| 254 |
+
# 在使用AutoGen插件时,是否使用Docker容器运行代码
|
| 255 |
+
AUTOGEN_USE_DOCKER = False
|
| 256 |
+
|
| 257 |
+
|
| 258 |
+
# 临时的上传文件夹位置,请勿修改
|
| 259 |
+
PATH_PRIVATE_UPLOAD = "private_upload"
|
| 260 |
+
|
| 261 |
+
|
| 262 |
+
# 日志文件夹的位置,请勿修改
|
| 263 |
+
PATH_LOGGING = "gpt_log"
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
# 除了连接OpenAI之外,还有哪些场合允许使用代理,请勿修改
|
| 267 |
+
WHEN_TO_USE_PROXY = ["Download_LLM", "Download_Gradio_Theme", "Connect_Grobid",
|
| 268 |
+
"Warmup_Modules", "Nougat_Download", "AutoGen"]
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
# *实验性功能*: 自动检测并屏蔽失效的KEY,请勿使用
|
| 272 |
+
BLOCK_INVALID_APIKEY = False
|
| 273 |
+
|
| 274 |
+
|
| 275 |
+
# 启用插件热加载
|
| 276 |
+
PLUGIN_HOT_RELOAD = False
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
# 自定义按钮的最大数量限制
|
| 280 |
+
NUM_CUSTOM_BASIC_BTN = 4
|
| 281 |
+
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
"""
|
| 285 |
+
--------------- 配置关联关系说明 ---------------
|
| 286 |
+
|
| 287 |
+
在线大模型配置关联关系示意图
|
| 288 |
+
│
|
| 289 |
+
├── "gpt-3.5-turbo" 等openai模型
|
| 290 |
+
│ ├── API_KEY
|
| 291 |
+
│ ├── CUSTOM_API_KEY_PATTERN(不常用)
|
| 292 |
+
│ ├── API_ORG(不常用)
|
| 293 |
+
│ └── API_URL_REDIRECT(不常用)
|
| 294 |
+
│
|
| 295 |
+
├── "azure-gpt-3.5" 等azure模型(单个azure模型,不需要动态切换)
|
| 296 |
+
│ ├── API_KEY
|
| 297 |
+
│ ├── AZURE_ENDPOINT
|
| 298 |
+
│ ├── AZURE_API_KEY
|
| 299 |
+
│ ├── AZURE_ENGINE
|
| 300 |
+
│ └── API_URL_REDIRECT
|
| 301 |
+
│
|
| 302 |
+
├── "azure-gpt-3.5" 等azure模型(多个azure模型,需要动态切换,高优先级)
|
| 303 |
+
│ └── AZURE_CFG_ARRAY
|
| 304 |
+
│
|
| 305 |
+
├── "spark" 星火认知大模型 spark & sparkv2
|
| 306 |
+
│ ├── XFYUN_APPID
|
| 307 |
+
│ ├── XFYUN_API_SECRET
|
| 308 |
+
│ └── XFYUN_API_KEY
|
| 309 |
+
│
|
| 310 |
+
├── "claude-3-opus-20240229" 等claude模型
|
| 311 |
+
│ └── ANTHROPIC_API_KEY
|
| 312 |
+
│
|
| 313 |
+
├── "stack-claude"
|
| 314 |
+
│ ├── SLACK_CLAUDE_BOT_ID
|
| 315 |
+
│ └── SLACK_CLAUDE_USER_TOKEN
|
| 316 |
+
│
|
| 317 |
+
├── "qianfan" 百度千帆大模型库
|
| 318 |
+
│ ├── BAIDU_CLOUD_QIANFAN_MODEL
|
| 319 |
+
│ ├── BAIDU_CLOUD_API_KEY
|
| 320 |
+
│ └── BAIDU_CLOUD_SECRET_KEY
|
| 321 |
+
│
|
| 322 |
+
├── "glm-4", "glm-3-turbo", "zhipuai" 智谱AI大模型
|
| 323 |
+
│ └── ZHIPUAI_API_KEY
|
| 324 |
+
│
|
| 325 |
+
├── "yi-34b-chat-0205", "yi-34b-chat-200k" 等零一万物(Yi Model)大模型
|
| 326 |
+
│ └── YIMODEL_API_KEY
|
| 327 |
+
│
|
| 328 |
+
├── "qwen-turbo" 等通义千问大模型
|
| 329 |
+
│ └── DASHSCOPE_API_KEY
|
| 330 |
+
│
|
| 331 |
+
├── "Gemini"
|
| 332 |
+
│ └── GEMINI_API_KEY
|
| 333 |
+
│
|
| 334 |
+
└── "one-api-...(max_token=...)" 用一种更方便的方式接入one-api多模型管理界面
|
| 335 |
+
├── AVAIL_LLM_MODELS
|
| 336 |
+
├── API_KEY
|
| 337 |
+
└── API_URL_REDIRECT
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
本地大模型示意图
|
| 341 |
+
│
|
| 342 |
+
├── "chatglm3"
|
| 343 |
+
├── "chatglm"
|
| 344 |
+
├── "chatglm_onnx"
|
| 345 |
+
├── "chatglmft"
|
| 346 |
+
├── "internlm"
|
| 347 |
+
├── "moss"
|
| 348 |
+
├── "jittorllms_pangualpha"
|
| 349 |
+
├── "jittorllms_llama"
|
| 350 |
+
├── "deepseekcoder"
|
| 351 |
+
├── "qwen-local"
|
| 352 |
+
├── RWKV的支持见Wiki
|
| 353 |
+
└── "llama2"
|
| 354 |
+
|
| 355 |
+
|
| 356 |
+
用户图形界面布局依赖关系示意图
|
| 357 |
+
│
|
| 358 |
+
├── CHATBOT_HEIGHT 对话窗的高度
|
| 359 |
+
├── CODE_HIGHLIGHT 代码高亮
|
| 360 |
+
├── LAYOUT 窗口布局
|
| 361 |
+
├── DARK_MODE 暗色模式 / 亮色模式
|
| 362 |
+
├── DEFAULT_FN_GROUPS 插件分类默认选项
|
| 363 |
+
├── THEME 色彩主题
|
| 364 |
+
├── AUTO_CLEAR_TXT 是否在提交时自动清空输入框
|
| 365 |
+
├── ADD_WAIFU 加一个live2d装饰
|
| 366 |
+
└── ALLOW_RESET_CONFIG 是否允许通过自然语言描述修改本页的配置,该功能具有一定的危险性
|
| 367 |
+
|
| 368 |
+
|
| 369 |
+
插件在线服务配置依赖关系示意图
|
| 370 |
+
│
|
| 371 |
+
├── 语音功能
|
| 372 |
+
│ ├── ENABLE_AUDIO
|
| 373 |
+
│ ├── ALIYUN_TOKEN
|
| 374 |
+
│ ├── ALIYUN_APPKEY
|
| 375 |
+
│ ├── ALIYUN_ACCESSKEY
|
| 376 |
+
│ └── ALIYUN_SECRET
|
| 377 |
+
│
|
| 378 |
+
└── PDF文档精准解析
|
| 379 |
+
├── GROBID_URLS
|
| 380 |
+
├── MATHPIX_APPID
|
| 381 |
+
└── MATHPIX_APPKEY
|
| 382 |
+
|
| 383 |
+
|
| 384 |
+
"""
|