Skip to content

Commit

Permalink
删除文心一言,请统一使用 千帆大模型
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Jul 24, 2024
1 parent f3deafb commit 4be9e6b
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 74 deletions.
14 changes: 0 additions & 14 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,6 @@
"bard": {
"token": ""
},
"yiyan": {
"type": "api",
"web": {
"api_ip_port": "http://127.0.0.1:3000",
"cookie": ""
},
"api": {
"api_key": "",
"secret_key": ""
},
"history_enable": true,
"history_max_len": 300
},
"tongyi": {
"cookie_path": "cookie/tongyi.json",
"type": "api",
Expand Down Expand Up @@ -1842,7 +1829,6 @@
"text_generation_webui": true,
"sparkdesk": true,
"bard": true,
"yiyan": true,
"tongyi": true,
"tongyixingchen": true,
"my_wenxinworkshop": true,
Expand Down
14 changes: 0 additions & 14 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -418,19 +418,6 @@
"bard": {
"token": ""
},
"yiyan": {
"type": "api",
"web": {
"api_ip_port": "http://127.0.0.1:3000",
"cookie": ""
},
"api": {
"api_key": "",
"secret_key": ""
},
"history_enable": true,
"history_max_len": 300
},
"tongyi": {
"cookie_path": "cookie/tongyi.json",
"type": "api",
Expand Down Expand Up @@ -1842,7 +1829,6 @@
"text_generation_webui": true,
"sparkdesk": true,
"bard": true,
"yiyan": true,
"tongyi": true,
"tongyixingchen": true,
"my_wenxinworkshop": true,
Expand Down
Binary file modified docs/AI Vtuber.xmind
Binary file not shown.
Binary file modified docs/xmind.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions utils/gpt_model/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from utils.gpt_model.langchain_chatchat import Langchain_ChatChat
from utils.gpt_model.zhipu import Zhipu
from utils.gpt_model.bard import Bard_api
from utils.gpt_model.yiyan import Yiyan
from utils.gpt_model.tongyi import TongYi
from utils.gpt_model.tongyixingchen import TongYiXingChen
from utils.gpt_model.my_qianfan import My_QianFan
Expand Down Expand Up @@ -49,7 +48,6 @@ def set_model_config(self, model_name, config):
"langchain_chatchat": Langchain_ChatChat,
"zhipu": Zhipu,
"bard": Bard_api,
"yiyan": Yiyan,
"tongyi": TongYi,
"tongyixingchen": TongYiXingChen,
"my_wenxinworkshop": My_WenXinWorkShop,
Expand Down
4 changes: 1 addition & 3 deletions utils/my_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ def __init__(self, config_path):
self.langchain_chatchat = None
self.zhipu = None
self.bard_api = None
self.yiyan = None
self.tongyi = None
self.tongyixingchen = None
self.my_qianfan = None
Expand All @@ -171,7 +170,7 @@ def __init__(self, config_path):
self.image_recognition_model = None

self.chat_type_list = ["chatgpt", "claude", "claude2", "chatglm", "qwen", "chat_with_file", "text_generation_webui", \
"sparkdesk", "langchain_chatglm", "langchain_chatchat", "zhipu", "bard", "yiyan", "tongyi", \
"sparkdesk", "langchain_chatglm", "langchain_chatchat", "zhipu", "bard", "tongyi", \
"tongyixingchen", "my_qianfan", "my_wenxinworkshop", "gemini", "qanything", "koboldcpp", "anythingllm", "gpt4free", \
"custom_llm", "llm_tpu", "dify"]

Expand Down Expand Up @@ -1519,7 +1518,6 @@ def llm_handle(self, chat_type, data, type="chat", webui_show=True):
"langchain_chatchat": lambda: self.langchain_chatchat.get_resp(data["content"]),
"zhipu": lambda: self.zhipu.get_resp(data["content"]),
"bard": lambda: self.bard_api.get_resp(data["content"]),
"yiyan": lambda: self.yiyan.get_resp(data["content"]),
"tongyi": lambda: self.tongyi.get_resp(data["content"]),
"tongyixingchen": lambda: self.tongyixingchen.get_resp(data["content"]),
"my_qianfan": lambda: self.my_qianfan.get_resp(data["content"]),
Expand Down
41 changes: 0 additions & 41 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2049,14 +2049,6 @@ def common_textarea_handle(content):
if config.get("webui", "show_card", "llm", "bard"):
config_data["bard"]["token"] = input_bard_token.value

if config.get("webui", "show_card", "llm", "yiyan"):
config_data["yiyan"]["type"] = select_yiyan_type.value
config_data["yiyan"]["history_enable"] = switch_yiyan_history_enable.value
config_data["yiyan"]["history_max_len"] = int(input_yiyan_history_max_len.value)
config_data["yiyan"]["api"]["api_key"] = input_yiyan_api_api_key.value
config_data["yiyan"]["api"]["secret_key"] = input_yiyan_api_secret_key.value
config_data["yiyan"]["web"]["api_ip_port"] = input_yiyan_web_api_ip_port.value
config_data["yiyan"]["web"]["cookie"] = input_yiyan_web_cookie.value

if config.get("webui", "show_card", "llm", "tongyi"):
config_data["tongyi"]["type"] = select_tongyi_type.value
Expand Down Expand Up @@ -2750,7 +2742,6 @@ def common_textarea_handle(content):
config_data["webui"]["show_card"]["llm"]["text_generation_webui"] = switch_webui_show_card_llm_text_generation_webui.value
config_data["webui"]["show_card"]["llm"]["sparkdesk"] = switch_webui_show_card_llm_sparkdesk.value
config_data["webui"]["show_card"]["llm"]["bard"] = switch_webui_show_card_llm_bard.value
config_data["webui"]["show_card"]["llm"]["yiyan"] = switch_webui_show_card_llm_yiyan.value
config_data["webui"]["show_card"]["llm"]["tongyi"] = switch_webui_show_card_llm_tongyi.value
config_data["webui"]["show_card"]["llm"]["tongyixingchen"] = switch_webui_show_card_llm_tongyixingchen.value
config_data["webui"]["show_card"]["llm"]["my_wenxinworkshop"] = switch_webui_show_card_llm_my_wenxinworkshop.value
Expand Down Expand Up @@ -2914,7 +2905,6 @@ def save_config():
'langchain_chatchat': 'langchain_chatchat',
'zhipu': '智谱AI',
'bard': 'Bard',
'yiyan': '文心一言',
'tongyixingchen': '通义星尘',
'my_wenxinworkshop': '千帆大模型',
'gemini': 'Gemini',
Expand Down Expand Up @@ -4195,36 +4185,6 @@ def local_qa_text_json_file_reload():
input_bard_token = ui.input(label='token', placeholder='登录bard,打开F12,在cookie中获取 __Secure-1PSID 对应的值', value=config.get("bard", "token"))
input_bard_token.style("width:400px")

if config.get("webui", "show_card", "llm", "yiyan"):
with ui.card().style(card_css):
ui.label("文心一言")
with ui.row():
lines = ['api', 'web']
data_json = {}
for line in lines:
data_json[line] = line
select_yiyan_type = ui.select(
label='类型',
options=data_json,
value=config.get("yiyan", "type")
).style("width:100px")
switch_yiyan_history_enable = ui.switch('上下文记忆', value=config.get("yiyan", "history_enable")).style(switch_internal_css)
input_yiyan_history_max_len = ui.input(label='最大记忆长度', value=config.get("yiyan", "history_max_len"), placeholder='最长能记忆的问答字符串长度,超长会丢弃最早记忆的内容,请慎用!配置过大可能会有丢大米')
with ui.row():
input_yiyan_api_api_key = ui.input(label='API Key', placeholder='千帆大模型 应用接入的API Key', value=config.get("yiyan", "api", "api_key"))
input_yiyan_api_secret_key = ui.input(label='Secret Key', placeholder='千帆大模型 应用接入的Secret Key', value=config.get("yiyan", "api", "secret_key"))
with ui.row():
input_yiyan_web_api_ip_port = ui.input(
label='API地址',
placeholder='yiyan-api启动后监听的ip端口地址',
value=config.get("yiyan", "web", "api_ip_port"),
validation={
'请输入正确格式的URL': lambda value: common.is_url_check(value),
}
)
input_yiyan_web_api_ip_port.style("width:300px")
input_yiyan_web_cookie = ui.input(label='cookie', placeholder='文心一言登录后,跳过debug后,抓取请求包中的cookie', value=config.get("yiyan", "web", "cookie"))
input_yiyan_web_cookie.style("width:300px")

if config.get("webui", "show_card", "llm", "tongyixingchen"):
with ui.card().style(card_css):
Expand Down Expand Up @@ -6425,7 +6385,6 @@ def update_echart_gift():
switch_webui_show_card_llm_text_generation_webui = ui.switch('text_generation_webui', value=config.get("webui", "show_card", "llm", "text_generation_webui")).style(switch_internal_css)
switch_webui_show_card_llm_sparkdesk = ui.switch('讯飞星火', value=config.get("webui", "show_card", "llm", "sparkdesk")).style(switch_internal_css)
switch_webui_show_card_llm_bard = ui.switch('bard', value=config.get("webui", "show_card", "llm", "bard")).style(switch_internal_css)
switch_webui_show_card_llm_yiyan = ui.switch('文心一言', value=config.get("webui", "show_card", "llm", "yiyan")).style(switch_internal_css)
switch_webui_show_card_llm_tongyi = ui.switch('通义千问', value=config.get("webui", "show_card", "llm", "tongyi")).style(switch_internal_css)
switch_webui_show_card_llm_tongyixingchen = ui.switch('通义星尘', value=config.get("webui", "show_card", "llm", "tongyixingchen")).style(switch_internal_css)
# switch_webui_show_card_llm_my_qianfan = ui.switch('my_qianfan', value=config.get("webui", "show_card", "llm", "my_qianfan")).style(switch_internal_css)
Expand Down

0 comments on commit 4be9e6b

Please sign in to comment.