Spaces:
Running
Running
Update config.py
#242
by
lang2023
- opened
config.py
CHANGED
@@ -8,11 +8,11 @@
|
|
8 |
"""
|
9 |
|
10 |
# [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项
|
11 |
-
API_KEY = "
|
12 |
|
13 |
|
14 |
# [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项
|
15 |
-
API_KEY = "
|
16 |
|
17 |
|
18 |
# [step 2]>> 改为True应用代理,如果直接在海外服务器部署,此处不修改;如果使用本地或无地域限制的大模型时,此处也不需要修改
|
@@ -28,8 +28,8 @@ if USE_PROXY:
|
|
28 |
# 代理网络的地址,打开你的*学*网软件查看代理的协议(socks5h / http)、地址(localhost)和端口(11284)
|
29 |
proxies = {
|
30 |
# [协议]:// [地址] :[端口]
|
31 |
-
"http": "
|
32 |
-
"https": "
|
33 |
}
|
34 |
else:
|
35 |
proxies = None
|
@@ -37,17 +37,17 @@ else:
|
|
37 |
# ------------------------------------ 以下配置可以优化体验, 但大部分场合下并不需要修改 ------------------------------------
|
38 |
|
39 |
# 重新URL重新定向,实现更换API_URL的作用(高危设置! 常规情况下不要修改! 通过修改此设置,您将把您的API-KEY和对话隐私完全暴露给您设定的中间人!)
|
40 |
-
# 格式: API_URL_REDIRECT = {"https://api.
|
41 |
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions"}
|
42 |
-
API_URL_REDIRECT = {}
|
43 |
|
44 |
|
45 |
# 多线程函数插件中,默认允许多少路线程同时访问OpenAI。Free trial users的限制是每分钟3次,Pay-as-you-go users的限制是每分钟3500次
|
46 |
# 一言以蔽之:免费(5刀)用户填3,OpenAI绑了信用卡的用户可以填 16 或者更高。提高限制请查询:https://platform.openai.com/docs/guides/rate-limits/overview
|
47 |
-
DEFAULT_WORKER_NUM = 3
|
48 |
|
49 |
|
50 |
-
# 色彩主题, 可选 ["Default", "Chuanhu-Small-and-Beautiful", "High-Contrast"]
|
51 |
# 更多主题, 请查阅Gradio主题商店: https://huggingface.co/spaces/gradio/theme-gallery 可选 ["Gstaff/Xkcd", "NoCrypt/Miku", ...]
|
52 |
THEME = "Chuanhu-Small-and-Beautiful"
|
53 |
|
@@ -86,7 +86,7 @@ DEFAULT_FN_GROUPS = ['对话', '编程', '学术']
|
|
86 |
|
87 |
# 模型选择是 (注意: LLM_MODEL是默认选中的模型, 它*必须*被包含在AVAIL_LLM_MODELS列表中 )
|
88 |
LLM_MODEL = "gpt-3.5-turbo" # 可选 ↓↓↓
|
89 |
-
AVAIL_LLM_MODELS = ["gpt-3.5-turbo-16k", "gpt-3.5-turbo", "azure-gpt-3.5", "api2d-gpt-3.5-turbo",
|
90 |
"gpt-4", "api2d-gpt-4", "chatglm", "moss", "newbing", "stack-claude"]
|
91 |
# P.S. 其他可用的模型还包括 ["qianfan", "llama2", "qwen", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k-0613",
|
92 |
# "spark", "sparkv2", "chatglm_onnx", "claude-1-100k", "claude-2", "internlm", "jittorllms_pangualpha", "jittorllms_llama"]
|
@@ -153,7 +153,7 @@ put your new bing cookies here
|
|
153 |
# 阿里云实时语音识别 配置难度较高 仅建议高手用户使用 参考 https://github.com/binary-husky/gpt_academic/blob/master/docs/use_audio.md
|
154 |
ENABLE_AUDIO = False
|
155 |
ALIYUN_TOKEN="" # 例如 f37f30e0f9934c34a992f6f64f7eba4f
|
156 |
-
ALIYUN_APPKEY="" # 例如 RoPlZrM88DnAFkZK
|
157 |
ALIYUN_ACCESSKEY="" # (无需填写)
|
158 |
ALIYUN_SECRET="" # (无需填写)
|
159 |
|
@@ -249,7 +249,7 @@ PATH_LOGGING = "gpt_log"
|
|
249 |
│ ├── ALIYUN_TOKEN
|
250 |
│ ├── ALIYUN_APPKEY
|
251 |
│ ├── ALIYUN_ACCESSKEY
|
252 |
-
│ └── ALIYUN_SECRET
|
253 |
│
|
254 |
├── PDF文档精准解析
|
255 |
│ └── GROBID_URLS
|
|
|
8 |
"""
|
9 |
|
10 |
# [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项
|
11 |
+
API_KEY = "sk-z1VfsYzJ5tEYChxcjjvXYcs5t1CEDntyYOzmS3DGyMCyzyMN" # 可同时填写多个API-KEY,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey3,azure-apikey4"
|
12 |
|
13 |
|
14 |
# [step 1]>> API_KEY = "sk-123456789xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx123456789"。极少数情况下,还需要填写组织(格式如org-123456789abcdefghijklmno的),请向下翻,找 API_ORG 设置项
|
15 |
+
API_KEY = "sk-z1VfsYzJ5tEYChxcjjvXYcs5t1CEDntyYOzmS3DGyMCyzyMN" # 可同时填写多个API-KEY,用英文逗号分割,例如API_KEY = "sk-openaikey1,sk-openaikey2,fkxxxx-api2dkey3,azure-apikey4"
|
16 |
|
17 |
|
18 |
# [step 2]>> 改为True应用代理,如果直接在海外服务器部署,此处不修改;如果使用本地或无地域限制的大模型时,此处也不需要修改
|
|
|
28 |
# 代理网络的地址,打开你的*学*网软件查看代理的协议(socks5h / http)、地址(localhost)和端口(11284)
|
29 |
proxies = {
|
30 |
# [协议]:// [地址] :[端口]
|
31 |
+
"http": "http://127.0.0.1:7980", # 再例如 "http": "http://127.0.0.1:7890",
|
32 |
+
"https": "http://127.0.0.1:7980", # 再例如 "https": "http://127.0.0.1:7890",
|
33 |
}
|
34 |
else:
|
35 |
proxies = None
|
|
|
37 |
# ------------------------------------ 以下配置可以优化体验, 但大部分场合下并不需要修改 ------------------------------------
|
38 |
|
39 |
# 重新URL重新定向,实现更换API_URL的作用(高危设置! 常规情况下不要修改! 通过修改此设置,您将把您的API-KEY和对话隐私完全暴露给您设定的中间人!)
|
40 |
+
# 格式: API_URL_REDIRECT = {"https://api.chatanywhere.com.cn/v1/chat/completions": "在这里填写重定向的api.openai.com的URL"}
|
41 |
# 举例: API_URL_REDIRECT = {"https://api.openai.com/v1/chat/completions": "https://reverse-proxy-url/v1/chat/completions"}
|
42 |
+
API_URL_REDIRECT = {}
|
43 |
|
44 |
|
45 |
# 多线程函数插件中,默认允许多少路线程同时访问OpenAI。Free trial users的限制是每分钟3次,Pay-as-you-go users的限制是每分钟3500次
|
46 |
# 一言以蔽之:免费(5刀)用户填3,OpenAI绑了信用卡的用户可以填 16 或者更高。提高限制请查询:https://platform.openai.com/docs/guides/rate-limits/overview
|
47 |
+
DEFAULT_WORKER_NUM = 3
|
48 |
|
49 |
|
50 |
+
# 色彩主题, 可选 ["Default", "Chuanhu-Small-and-Beautiful", "High-Contrast"]
|
51 |
# 更多主题, 请查阅Gradio主题商店: https://huggingface.co/spaces/gradio/theme-gallery 可选 ["Gstaff/Xkcd", "NoCrypt/Miku", ...]
|
52 |
THEME = "Chuanhu-Small-and-Beautiful"
|
53 |
|
|
|
86 |
|
87 |
# 模型选择是 (注意: LLM_MODEL是默认选中的模型, 它*必须*被包含在AVAIL_LLM_MODELS列表中 )
|
88 |
LLM_MODEL = "gpt-3.5-turbo" # 可选 ↓↓↓
|
89 |
+
AVAIL_LLM_MODELS = ["gpt-3.5-turbo-16k", "gpt-3.5-turbo", "azure-gpt-3.5", "api2d-gpt-3.5-turbo",
|
90 |
"gpt-4", "api2d-gpt-4", "chatglm", "moss", "newbing", "stack-claude"]
|
91 |
# P.S. 其他可用的模型还包括 ["qianfan", "llama2", "qwen", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-16k-0613",
|
92 |
# "spark", "sparkv2", "chatglm_onnx", "claude-1-100k", "claude-2", "internlm", "jittorllms_pangualpha", "jittorllms_llama"]
|
|
|
153 |
# 阿里云实时语音识别 配置难度较高 仅建议高手用户使用 参考 https://github.com/binary-husky/gpt_academic/blob/master/docs/use_audio.md
|
154 |
ENABLE_AUDIO = False
|
155 |
ALIYUN_TOKEN="" # 例如 f37f30e0f9934c34a992f6f64f7eba4f
|
156 |
+
ALIYUN_APPKEY="" # 例如 RoPlZrM88DnAFkZK
|
157 |
ALIYUN_ACCESSKEY="" # (无需填写)
|
158 |
ALIYUN_SECRET="" # (无需填写)
|
159 |
|
|
|
249 |
│ ├── ALIYUN_TOKEN
|
250 |
│ ├── ALIYUN_APPKEY
|
251 |
│ ├── ALIYUN_ACCESSKEY
|
252 |
+
│ └── ALIYUN_SECRET
|
253 |
│
|
254 |
├── PDF文档精准解析
|
255 |
│ └── GROBID_URLS
|