Spaces:
Runtime error
Runtime error
Commit
·
dcd4379
1
Parent(s):
91d2638
Update utils.py
Browse files
utils.py
CHANGED
|
@@ -25,27 +25,25 @@ model_select_dropdown="gpt-3.5-turbo"
|
|
| 25 |
dockerflag = True
|
| 26 |
authflag = False
|
| 27 |
|
| 28 |
-
# ChatGPT 设置
|
| 29 |
initial_prompt = "You are a helpful assistant."
|
| 30 |
API_URL = "https://api.openai.com/v1/chat/completions"
|
| 31 |
HISTORY_DIR = "history"
|
| 32 |
TEMPLATES_DIR = "./"
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
HIDE_MY_KEY = True # 如果你想在UI中隐藏你的 API 密钥,将此值设置为 True
|
| 49 |
|
| 50 |
SIM_K = 5
|
| 51 |
INDEX_QUERY_TEMPRATURE = 1.0
|
|
@@ -157,6 +155,8 @@ def convert_mdtext(md_text):
|
|
| 157 |
else:
|
| 158 |
result.append(mdtex2html.convert(non_code, extensions=["tables"]))
|
| 159 |
if code.strip():
|
|
|
|
|
|
|
| 160 |
code = f"```{code}\n\n```"
|
| 161 |
code = markdown_to_html_with_syntax_highlight(code)
|
| 162 |
result.append(code)
|
|
|
|
| 25 |
dockerflag = True
|
| 26 |
authflag = False
|
| 27 |
|
|
|
|
| 28 |
initial_prompt = "You are a helpful assistant."
|
| 29 |
API_URL = "https://api.openai.com/v1/chat/completions"
|
| 30 |
HISTORY_DIR = "history"
|
| 31 |
TEMPLATES_DIR = "./"
|
| 32 |
|
| 33 |
+
standard_error_msg = "Error:"
|
| 34 |
+
error_retrieve_prompt = "Please check the network connection and the API-Key"
|
| 35 |
+
connection_timeout_prompt = "Time out"
|
| 36 |
+
read_timeout_prompt = "Time out"
|
| 37 |
+
proxy_error_prompt = "Proxy error"
|
| 38 |
+
ssl_error_prompt = "SSL error"
|
| 39 |
+
no_apikey_msg = "please check whether the input is correct"
|
| 40 |
+
|
| 41 |
+
max_token_streaming = 3500
|
| 42 |
+
timeout_streaming = 10
|
| 43 |
+
max_token_all = 3500
|
| 44 |
+
timeout_all = 200
|
| 45 |
+
enable_streaming_option = True
|
| 46 |
+
HIDE_MY_KEY = True
|
|
|
|
| 47 |
|
| 48 |
SIM_K = 5
|
| 49 |
INDEX_QUERY_TEMPRATURE = 1.0
|
|
|
|
| 155 |
else:
|
| 156 |
result.append(mdtex2html.convert(non_code, extensions=["tables"]))
|
| 157 |
if code.strip():
|
| 158 |
+
# _, code = detect_language(code) # 暂时去除代码高亮功能,因为在大段代码的情况下会出现问题
|
| 159 |
+
# code = code.replace("\n\n", "\n") # 暂时去除代码中的空行,因为在大段代码的情况下会出现问题
|
| 160 |
code = f"```{code}\n\n```"
|
| 161 |
code = markdown_to_html_with_syntax_highlight(code)
|
| 162 |
result.append(code)
|