Skip to content

Commit

Permalink
文档:赞助更新
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikaros-521 committed Oct 25, 2024
1 parent 2e02ac7 commit ee4ae65
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ AIHubMix: [aihubmix.com](https://aihubmix.com/register?aff=1BMI) ———— O
### 🙌 赞助

<div>
<img src="https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240614173255_zfb2.jpg" style="width: 200px;">
<img src="https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_240614173255_wx2.jpg" style="width: 230px;">
<img src="https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_230719075908_%E6%94%AF%E4%BB%98%E5%AE%9D.png" style="width: 200px;">
<img src="https://images.cnblogs.com/cnblogs_com/ikaros-521/2328032/o_230719075908_%E5%BE%AE%E4%BF%A1.png" style="width: 230px;">
</div>

## 🕳️ 黑名单
Expand Down
2 changes: 2 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
"follow": 20,
"key_mapping": 20,
"integral": 20,
"assistant_anchor_text": 25,
"assistant_anchor_audio": 25,
"talk": 30,
"reread": 30,
"reread_top_priority": 999
Expand Down
2 changes: 2 additions & 0 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
"follow": 20,
"key_mapping": 20,
"integral": 20,
"assistant_anchor_text": 25,
"assistant_anchor_audio": 25,
"talk": 30,
"reread": 30,
"reread_top_priority": 999
Expand Down
20 changes: 11 additions & 9 deletions tests/test_aibote/aibote.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,25 @@ def script_main(self):
# 查询所有窗口句柄
# result = self.find_windows()
# print(result)

print("开始执行自定义脚本")

# 使用示例 [Demo]
result = self.init_speech_clone_service("178asdf325c95eafdaaasee3bbf64741", "tIdj8l8nPdqV86Ueasdf")
print(result)

# 使用示例 [Demo]
# result = self.init_metahuman("D:/AiboteMetahuman/metahumanMode", 0.5, 0.5, False)
result = self.init_metahuman("F:/AiboteHumanLive/DigitalHumanMain_V1.0.4_RC/Static/humanModelFemale", 0.5, 0.5, False)
print(result)

# result = self.train_human_model(
# "dfjklDJFLJlfjkdljf",
# "E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\1.png",
# "E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\humanModel",
# "E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\newHumanModel"
# )
# print(result)

result = self.train_human_model(
"dfjklDJFLJlfjkdljf",
"E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\1.png",
"E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\humanModel",
"E:\\GitHub_pro\\AI-Vtuber\\tests\\test_aibote\\newHumanModel"
)
print(result)
result = self.metahuman_speech("D:/AiboteMetahuman/voice/1.mp3", "PyAibote is an excellent automation framework", "zh-cn", "zh-cn-XiaochenNeural", 0, True, 0, "General")


if __name__ == '__main__':
Expand Down
2 changes: 2 additions & 0 deletions utils/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ def data_priority_insert(self, type:str="等待合成消息", data_json:dict=Non
abnormal_alarm 异常报警
image_recognition_schedule 图像识别定时任务
trends_copywriting 动态文案
assistant_anchor_text 助播-文本
assistant_anchor_audio 助播-音频
"""
logger.debug(f"message_queue: {Audio.message_queue}")
logger.debug(f"data_json: {data_json}")
Expand Down
15 changes: 15 additions & 0 deletions utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,21 @@ async def send_async_request(self, url: str, method: str='GET', json_data: dict=
logger.error(f"请求出错: {e}")
return None

async def send_heartbeat(self):
"""
发送异步 HTTP 请求并返回结果
Returns:
dict|str: 包含响应的 JSON数据 | 字符串数据
"""
try:
await self.send_async_request("http://124.221.164.49:8001/heartbeat", "POST", None)
except Exception as e:
# logger.error(traceback.format_exc())
# logger.error(f"请求出错: {e}")
return None


def check_login(self, api_url: str, username: str, password: str):
try:
data_json = {
Expand Down
16 changes: 13 additions & 3 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,6 +1820,8 @@ def update_config(config_mapping, config, config_data, type="common_config"):
"abnormal_alarm": (input_filter_priority_mapping_abnormal_alarm, 'int'),
"trends_copywriting": (input_filter_priority_mapping_trends_copywriting, 'int'),
"schedule": (input_filter_priority_mapping_schedule, 'int'),
"assistant_anchor_text": (input_filter_priority_mapping_assistant_anchor_text, 'int'),
"assistant_anchor_audio": (input_filter_priority_mapping_assistant_anchor_audio, 'int'),
},
"blacklist": {
"enable": (switch_filter_blacklist_enable, 'bool'),
Expand Down Expand Up @@ -3632,11 +3634,13 @@ def save_config():
with ui.element('div').classes('p-2 bg-blue-100'):
ui.label("下方优先级配置,请使用正整数。数字越大,优先级越高,就会优先合成音频播放")
ui.label("另外需要注意,由于shi山原因,目前这个队列内容是文本切分后计算的长度,所以如果回复内容过长,可能会有丢数据的情况")
with ui.grid(columns=4):
with ui.grid(columns=5):
input_filter_priority_mapping_idle_time_task = ui.input(label='闲时任务 优先级', value=config.get("filter", "priority_mapping", "idle_time_task"), placeholder='数字越大,优先级越高,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_image_recognition_schedule = ui.input(label='图像识别 优先级', value=config.get("filter", "priority_mapping", "image_recognition_schedule"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_local_qa_audio = ui.input(label='本地问答-音频 优先级', value=config.get("filter", "priority_mapping", "local_qa_audio"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_comment = ui.input(label='弹幕回复 优先级', value=config.get("filter", "priority_mapping", "comment"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_copywriting = ui.input(label='文案 优先级', value=config.get("filter", "priority_mapping", "copywriting"), placeholder='数字越大,优先级越高,文案页的文案,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')

with ui.grid(columns=5):
input_filter_priority_mapping_song = ui.input(label='点歌 优先级', value=config.get("filter", "priority_mapping", "song"), placeholder='数字越大,优先级越高,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_read_comment = ui.input(label='念弹幕 优先级', value=config.get("filter", "priority_mapping", "read_comment"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
Expand All @@ -3650,11 +3654,14 @@ def save_config():
input_filter_priority_mapping_integral = ui.input(label='积分 优先级', value=config.get("filter", "priority_mapping", "integral"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_reread_top_priority = ui.input(label='最高优先级复读 优先级', value=config.get("filter", "priority_mapping", "reread_top_priority"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')

with ui.grid(columns=4):
input_filter_priority_mapping_copywriting = ui.input(label='文案 优先级', value=config.get("filter", "priority_mapping", "copywriting"), placeholder='数字越大,优先级越高,文案页的文案,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
with ui.grid(columns=5):
input_filter_priority_mapping_abnormal_alarm = ui.input(label='异常报警 优先级', value=config.get("filter", "priority_mapping", "abnormal_alarm"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_trends_copywriting = ui.input(label='动态文案 优先级', value=config.get("filter", "priority_mapping", "trends_copywriting"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_schedule = ui.input(label='定时任务 优先级', value=config.get("filter", "priority_mapping", "schedule"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_assistant_anchor_text = ui.input(label='助播-文本 优先级', value=config.get("filter", "priority_mapping", "assistant_anchor_text"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_assistant_anchor_audio = ui.input(label='助播-音频 优先级', value=config.get("filter", "priority_mapping", "assistant_anchor_audio"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')


with ui.expansion('弹幕黑名单', icon="settings", value=True).classes('w-full'):
with ui.row():
switch_filter_blacklist_enable = ui.switch('启用', value=config.get("filter", "blacklist", "enable")).style(switch_internal_css)
Expand Down Expand Up @@ -7350,6 +7357,9 @@ def update_echart_gift():
logger.info("自动运行 已启用")
run_external_program(type="api")

# 发送心跳包
ui.timer(9 * 60, lambda: common.send_heartbeat())

# 是否启用登录功能(暂不合理)
if config.get("login", "enable"):

Expand Down

0 comments on commit ee4ae65

Please sign in to comment.