pick 部分代码
This commit is contained in:
@ -181,7 +181,7 @@ def request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency(
|
|||||||
executor = ThreadPoolExecutor(max_workers=max_workers)
|
executor = ThreadPoolExecutor(max_workers=max_workers)
|
||||||
n_frag = len(inputs_array)
|
n_frag = len(inputs_array)
|
||||||
# 用户反馈
|
# 用户反馈
|
||||||
chatbot.append(["请开始多线程操作。", ""])
|
chatbot.append([None, ""])
|
||||||
yield from update_ui(chatbot=chatbot, history=[]) # 刷新界面
|
yield from update_ui(chatbot=chatbot, history=[]) # 刷新界面
|
||||||
# 跨线程传递
|
# 跨线程传递
|
||||||
mutable = [["", time.time(), "等待中"] for _ in range(n_frag)]
|
mutable = [["", time.time(), "等待中"] for _ in range(n_frag)]
|
||||||
|
|||||||
@ -45,6 +45,7 @@ mspace {
|
|||||||
|
|
||||||
#debug_mes {
|
#debug_mes {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
display: flex;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@ -99,4 +99,4 @@ def inset_127_prompt():
|
|||||||
|
|
||||||
sqlite_handle = SqliteHandle
|
sqlite_handle = SqliteHandle
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print(sqlite_handle().find_prompt_result('文档转Markdown'))
|
cp_db_data()
|
||||||
13
toolbox.py
13
toolbox.py
@ -594,7 +594,7 @@ def is_api2d_key(key):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def is_proxy_key(key):
|
def is_proxy_key(key):
|
||||||
if 'proxy' in key:
|
if key.startswith('proxy-') and len(key) == 37:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
@ -620,7 +620,14 @@ def what_keys(keys):
|
|||||||
if is_api2d_key(k):
|
if is_api2d_key(k):
|
||||||
avail_key_list['API2D Key'] += 1
|
avail_key_list['API2D Key'] += 1
|
||||||
|
|
||||||
return f"检测到: OpenAI Key {avail_key_list['OpenAI Key']} 个,API2D Key {avail_key_list['API2D Key']} 个"
|
for k in key_list:
|
||||||
|
if is_proxy_key(k):
|
||||||
|
avail_key_list['Proxy Key'] += 1
|
||||||
|
|
||||||
|
return f"检测到: \n" \
|
||||||
|
f"OpenAI Key {avail_key_list['OpenAI Key']} 个\n" \
|
||||||
|
f"API2D Key {avail_key_list['API2D Key']} 个\n" \
|
||||||
|
f"Proxy Key {avail_key_list['API2D Key']} 个\n"
|
||||||
|
|
||||||
def select_api_key(keys, llm_model):
|
def select_api_key(keys, llm_model):
|
||||||
import random
|
import random
|
||||||
@ -635,7 +642,7 @@ def select_api_key(keys, llm_model):
|
|||||||
for k in key_list:
|
for k in key_list:
|
||||||
if is_api2d_key(k): avail_key_list.append(k)
|
if is_api2d_key(k): avail_key_list.append(k)
|
||||||
|
|
||||||
if llm_model.startswith('proxy'):
|
if llm_model.startswith('proxy-'):
|
||||||
for k in key_list:
|
for k in key_list:
|
||||||
if is_proxy_key(k): avail_key_list.append(k.replace('proxy-', ''))
|
if is_proxy_key(k): avail_key_list.append(k.replace('proxy-', ''))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user