Skip to content

Commit

Permalink
Merge pull request Ikaros-521#910 from Ikaros-521/owner
Browse files Browse the repository at this point in the history
webui 通用配置的聊天类型 改名为 大语言模型;通用函数增加异常捕获
  • Loading branch information
Ikaros-521 authored Jul 2, 2024
2 parents e7a3c27 + f6b3069 commit c07db3d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 19 deletions.
15 changes: 15 additions & 0 deletions docs/投资人/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240327133453_%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20240327213240.jpg",
amount: "188"
},
{
name: "老白",
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240628130530_AgAABTM-uTiGKrleP8dEO6VHEZmSTXtl.jpeg",
amount: "188.88"
},
{
name: "花开一季",
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_230817152316_QQ%E5%9B%BE%E7%89%8720230817232145.jpg",
Expand Down Expand Up @@ -351,6 +356,16 @@
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240409155719_QQ%E5%9B%BE%E7%89%8720240409235702.jpg",
amount: "100"
},
{
name: "阿稻",
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240628130529_QQ%E5%9B%BE%E7%89%8720240628210300.jpg",
amount: "100"
},
{
name: "蠢蛋不蠢",
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240629124609_QQ%E5%9B%BE%E7%89%8720240629204502.jpg",
amount: "100"
},
{
name: "很养眼的丑男",
avatar: "https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_230722162732_QQ%E5%9B%BE%E7%89%8720230723000544.jpg",
Expand Down
Binary file modified docs/投资人/invest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 22 additions & 18 deletions utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,24 +243,28 @@ def convert_digits_to_chinese(self, input_str: str):
Returns:
str: 转换后的字符串
"""
# 定义阿拉伯数字到中文数字的映射
digit_to_chinese = {
'0': '零',
'1': '一',
'2': '二',
'3': '三',
'4': '四',
'5': '五',
'6': '六',
'7': '七',
'8': '八',
'9': '九'
}

# 遍历输入字符串并替换数字为中文数字
result = ''.join(digit_to_chinese.get(char, char) for char in input_str)

return result
try:
# 定义阿拉伯数字到中文数字的映射
digit_to_chinese = {
'0': '零',
'1': '一',
'2': '二',
'3': '三',
'4': '四',
'5': '五',
'6': '六',
'7': '七',
'8': '八',
'9': '九'
}

# 遍历输入字符串并替换数字为中文数字
result = ''.join(digit_to_chinese.get(char, char) for char in input_str)

return result
except Exception as e:
logger.error(f"转换数字到中文时出错: {e}")
return input_str

# 删除多余单词
def remove_extra_words(self, text="", max_len=30, max_char_len=50):
Expand Down
2 changes: 1 addition & 1 deletion webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2889,7 +2889,7 @@ def save_config():
input_room_display_id = ui.input(label='直播间号', placeholder='一般为直播间URL最后/后面的字母或数字', value=config.get("room_display_id")).style("width:200px;").tooltip('一般为直播间URL最后/后面的字母或数字')

select_chat_type = ui.select(
label='聊天类型',
label='大语言模型',
options=chat_type_options,
value=config.get("chat_type")
).style("width:200px;").tooltip('选用的LLM类型。相关的弹幕信息等会传递给此LLM进行推理,获取回答')
Expand Down

0 comments on commit c07db3d

Please sign in to comment.