From fa294ba62a66b9e79c8ecb609929d0a03c9bab08 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Wed, 28 Feb 2024 14:46:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4PyQT=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- UI_main.py | 2706 ---------------------------- main-old.py | 4979 --------------------------------------------------- ui/main.ui | 4420 --------------------------------------------- 3 files changed, 12105 deletions(-) delete mode 100644 UI_main.py delete mode 100644 main-old.py delete mode 100644 ui/main.ui diff --git a/UI_main.py b/UI_main.py deleted file mode 100644 index 2d10f387..00000000 --- a/UI_main.py +++ /dev/null @@ -1,2706 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'ui\main.ui' -# -# Created by: PyQt5 UI code generator 5.15.9 -# -# WARNING: Any manual changes made to this file will be lost when pyuic5 is -# run again. Do not edit this file unless you know what you are doing. - - -from PyQt5 import QtCore, QtGui, QtWidgets - - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(1191, 834) - MainWindow.setStyleSheet("background-color: rgba(255, 255, 255, 50);") - self.centralwidget = QtWidgets.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.gridLayout_20 = QtWidgets.QGridLayout(self.centralwidget) - self.gridLayout_20.setObjectName("gridLayout_20") - self.pushButton_run_page = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_run_page.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_run_page.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #e6a23c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_run_page.setObjectName("pushButton_run_page") - self.gridLayout_20.addWidget(self.pushButton_run_page, 4, 1, 1, 1) - self.pushButton_copywriting_page = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_copywriting_page.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_page.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #e6a23c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_copywriting_page.setObjectName("pushButton_copywriting_page") - self.gridLayout_20.addWidget(self.pushButton_copywriting_page, 5, 1, 1, 1) - self.pushButton_run = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_run.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_run.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: rgba(103, 194, 58, 255);\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_run.setObjectName("pushButton_run") - self.gridLayout_20.addWidget(self.pushButton_run, 1, 1, 1, 1) - self.pushButton_config_page = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_config_page.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_config_page.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #e6a23c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_config_page.setObjectName("pushButton_config_page") - self.gridLayout_20.addWidget(self.pushButton_config_page, 3, 1, 1, 1) - self.pushButton_save = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_save.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_save.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: rgba(64, 158, 255, 255);\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_save.setObjectName("pushButton_save") - self.gridLayout_20.addWidget(self.pushButton_save, 0, 1, 1, 1) - self.stackedWidget = QtWidgets.QStackedWidget(self.centralwidget) - self.stackedWidget.setStyleSheet("background-color: rgba(255, 255, 255, 0);\n" -"font: 75 14pt \"微软雅黑\";") - self.stackedWidget.setObjectName("stackedWidget") - self.page = QtWidgets.QWidget() - self.page.setObjectName("page") - self.gridLayout_21 = QtWidgets.QGridLayout(self.page) - self.gridLayout_21.setObjectName("gridLayout_21") - self.scrollArea = QtWidgets.QScrollArea(self.page) - self.scrollArea.setStyleSheet("font: 75 14pt \"微软雅黑\";\n" -"background-color: rgba(255, 255, 255, 50);\n" -"") - self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded) - self.scrollArea.setWidgetResizable(True) - self.scrollArea.setObjectName("scrollArea") - self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, -6720, 991, 11374)) - self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") - self.verticalLayout = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) - self.verticalLayout.setContentsMargins(35, 20, 35, 20) - self.verticalLayout.setSpacing(20) - self.verticalLayout.setObjectName("verticalLayout") - self.formWidget = QtWidgets.QWidget(self.scrollAreaWidgetContents) - self.formWidget.setStyleSheet("background-color: rgba(255, 255, 255, 0);") - self.formWidget.setObjectName("formWidget") - self.gridLayout = QtWidgets.QGridLayout(self.formWidget) - self.gridLayout.setContentsMargins(0, 0, 0, 0) - self.gridLayout.setObjectName("gridLayout") - self.comboBox_audio_synthesis_type = QtWidgets.QComboBox(self.formWidget) - self.comboBox_audio_synthesis_type.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.comboBox_audio_synthesis_type.setObjectName("comboBox_audio_synthesis_type") - self.gridLayout.addWidget(self.comboBox_audio_synthesis_type, 11, 1, 1, 1) - self.groupBox_read_comment = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_read_comment.setObjectName("groupBox_read_comment") - self.gridLayout_75 = QtWidgets.QGridLayout(self.groupBox_read_comment) - self.gridLayout_75.setObjectName("gridLayout_75") - self.gridLayout_read_comment = QtWidgets.QGridLayout() - self.gridLayout_read_comment.setObjectName("gridLayout_read_comment") - self.gridLayout_75.addLayout(self.gridLayout_read_comment, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_read_comment, 20, 0, 1, 2) - self.label_before_prompt = QtWidgets.QLabel(self.formWidget) - self.label_before_prompt.setObjectName("label_before_prompt") - self.gridLayout.addWidget(self.label_before_prompt, 5, 0, 1, 1) - self.groupBox_audio_random_speed = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_audio_random_speed.setObjectName("groupBox_audio_random_speed") - self.gridLayout_53 = QtWidgets.QGridLayout(self.groupBox_audio_random_speed) - self.gridLayout_53.setObjectName("gridLayout_53") - self.gridLayout_52 = QtWidgets.QGridLayout() - self.gridLayout_52.setObjectName("gridLayout_52") - self.lineEdit_audio_random_speed_normal_speed_min = QtWidgets.QLineEdit(self.groupBox_audio_random_speed) - self.lineEdit_audio_random_speed_normal_speed_min.setObjectName("lineEdit_audio_random_speed_normal_speed_min") - self.gridLayout_52.addWidget(self.lineEdit_audio_random_speed_normal_speed_min, 2, 1, 1, 1) - self.label_audio_random_speed_normal_enable = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_normal_enable.setObjectName("label_audio_random_speed_normal_enable") - self.gridLayout_52.addWidget(self.label_audio_random_speed_normal_enable, 1, 0, 1, 1) - self.label_audio_random_speed_normal_speed_min = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_normal_speed_min.setObjectName("label_audio_random_speed_normal_speed_min") - self.gridLayout_52.addWidget(self.label_audio_random_speed_normal_speed_min, 2, 0, 1, 1) - self.label_audio_random_speed_normal_speed_max = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_normal_speed_max.setObjectName("label_audio_random_speed_normal_speed_max") - self.gridLayout_52.addWidget(self.label_audio_random_speed_normal_speed_max, 2, 2, 1, 1) - self.checkBox_audio_random_speed_normal_enable = QtWidgets.QCheckBox(self.groupBox_audio_random_speed) - self.checkBox_audio_random_speed_normal_enable.setObjectName("checkBox_audio_random_speed_normal_enable") - self.gridLayout_52.addWidget(self.checkBox_audio_random_speed_normal_enable, 1, 1, 1, 1) - self.lineEdit_audio_random_speed_normal_speed_max = QtWidgets.QLineEdit(self.groupBox_audio_random_speed) - self.lineEdit_audio_random_speed_normal_speed_max.setObjectName("lineEdit_audio_random_speed_normal_speed_max") - self.gridLayout_52.addWidget(self.lineEdit_audio_random_speed_normal_speed_max, 2, 3, 1, 1) - self.label_audio_random_speed_copywriting_enable = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_copywriting_enable.setObjectName("label_audio_random_speed_copywriting_enable") - self.gridLayout_52.addWidget(self.label_audio_random_speed_copywriting_enable, 3, 0, 1, 1) - self.checkBox_audio_random_speed_copywriting_enable = QtWidgets.QCheckBox(self.groupBox_audio_random_speed) - self.checkBox_audio_random_speed_copywriting_enable.setObjectName("checkBox_audio_random_speed_copywriting_enable") - self.gridLayout_52.addWidget(self.checkBox_audio_random_speed_copywriting_enable, 3, 1, 1, 1) - self.label_audio_random_speed_copywriting_speed_min = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_copywriting_speed_min.setObjectName("label_audio_random_speed_copywriting_speed_min") - self.gridLayout_52.addWidget(self.label_audio_random_speed_copywriting_speed_min, 4, 0, 1, 1) - self.lineEdit_audio_random_speed_copywriting_speed_min = QtWidgets.QLineEdit(self.groupBox_audio_random_speed) - self.lineEdit_audio_random_speed_copywriting_speed_min.setObjectName("lineEdit_audio_random_speed_copywriting_speed_min") - self.gridLayout_52.addWidget(self.lineEdit_audio_random_speed_copywriting_speed_min, 4, 1, 1, 1) - self.label_audio_random_speed_copywriting_speed_max = QtWidgets.QLabel(self.groupBox_audio_random_speed) - self.label_audio_random_speed_copywriting_speed_max.setObjectName("label_audio_random_speed_copywriting_speed_max") - self.gridLayout_52.addWidget(self.label_audio_random_speed_copywriting_speed_max, 4, 2, 1, 1) - self.lineEdit_audio_random_speed_copywriting_speed_max = QtWidgets.QLineEdit(self.groupBox_audio_random_speed) - self.lineEdit_audio_random_speed_copywriting_speed_max.setObjectName("lineEdit_audio_random_speed_copywriting_speed_max") - self.gridLayout_52.addWidget(self.lineEdit_audio_random_speed_copywriting_speed_max, 4, 3, 1, 1) - self.gridLayout_52.setColumnStretch(0, 1) - self.gridLayout_52.setColumnStretch(1, 2) - self.gridLayout_52.setColumnStretch(2, 1) - self.gridLayout_52.setColumnStretch(3, 2) - self.gridLayout_53.addLayout(self.gridLayout_52, 0, 0, 1, 1) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_53.addItem(spacerItem, 0, 1, 1, 1) - self.gridLayout_53.setColumnStretch(0, 9) - self.gridLayout_53.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_audio_random_speed, 29, 0, 1, 3) - self.groupBox_read_user_name = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_read_user_name.setObjectName("groupBox_read_user_name") - self.gridLayout_59 = QtWidgets.QGridLayout(self.groupBox_read_user_name) - self.gridLayout_59.setObjectName("gridLayout_59") - self.gridLayout_58 = QtWidgets.QGridLayout() - self.gridLayout_58.setObjectName("gridLayout_58") - self.label_read_user_name_reply_before = QtWidgets.QLabel(self.groupBox_read_user_name) - self.label_read_user_name_reply_before.setObjectName("label_read_user_name_reply_before") - self.gridLayout_58.addWidget(self.label_read_user_name_reply_before, 2, 0, 1, 1) - self.textEdit_read_user_name_reply_before = QtWidgets.QTextEdit(self.groupBox_read_user_name) - self.textEdit_read_user_name_reply_before.setObjectName("textEdit_read_user_name_reply_before") - self.gridLayout_58.addWidget(self.textEdit_read_user_name_reply_before, 2, 1, 1, 1) - self.label_read_user_name_enable = QtWidgets.QLabel(self.groupBox_read_user_name) - self.label_read_user_name_enable.setObjectName("label_read_user_name_enable") - self.gridLayout_58.addWidget(self.label_read_user_name_enable, 0, 0, 1, 1) - self.checkBox_read_user_name_enable = QtWidgets.QCheckBox(self.groupBox_read_user_name) - self.checkBox_read_user_name_enable.setObjectName("checkBox_read_user_name_enable") - self.gridLayout_58.addWidget(self.checkBox_read_user_name_enable, 0, 1, 1, 1) - self.label_read_user_name_voice_change = QtWidgets.QLabel(self.groupBox_read_user_name) - self.label_read_user_name_voice_change.setObjectName("label_read_user_name_voice_change") - self.gridLayout_58.addWidget(self.label_read_user_name_voice_change, 1, 0, 1, 1) - self.checkBox_read_user_name_voice_change = QtWidgets.QCheckBox(self.groupBox_read_user_name) - self.checkBox_read_user_name_voice_change.setObjectName("checkBox_read_user_name_voice_change") - self.gridLayout_58.addWidget(self.checkBox_read_user_name_voice_change, 1, 1, 1, 1) - self.label_read_user_name_reply_after = QtWidgets.QLabel(self.groupBox_read_user_name) - self.label_read_user_name_reply_after.setObjectName("label_read_user_name_reply_after") - self.gridLayout_58.addWidget(self.label_read_user_name_reply_after, 3, 0, 1, 1) - self.textEdit_read_user_name_reply_after = QtWidgets.QTextEdit(self.groupBox_read_user_name) - self.textEdit_read_user_name_reply_after.setObjectName("textEdit_read_user_name_reply_after") - self.gridLayout_58.addWidget(self.textEdit_read_user_name_reply_after, 3, 1, 1, 1) - self.gridLayout_59.addLayout(self.gridLayout_58, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_read_user_name, 21, 0, 1, 2) - self.groupBox_play_audio = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_play_audio.setObjectName("groupBox_play_audio") - self.gridLayout_68 = QtWidgets.QGridLayout(self.groupBox_play_audio) - self.gridLayout_68.setObjectName("gridLayout_68") - self.gridLayout_play_audio = QtWidgets.QGridLayout() - self.gridLayout_play_audio.setObjectName("gridLayout_play_audio") - self.gridLayout_68.addLayout(self.gridLayout_play_audio, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_play_audio, 17, 0, 1, 2) - self.label_platform = QtWidgets.QLabel(self.formWidget) - self.label_platform.setAutoFillBackground(False) - self.label_platform.setObjectName("label_platform") - self.gridLayout.addWidget(self.label_platform, 0, 0, 1, 1) - self.label_need_lang = QtWidgets.QLabel(self.formWidget) - self.label_need_lang.setObjectName("label_need_lang") - self.gridLayout.addWidget(self.label_need_lang, 4, 0, 1, 1) - self.groupBox_show_box = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_show_box.setObjectName("groupBox_show_box") - self.gridLayout_62 = QtWidgets.QGridLayout(self.groupBox_show_box) - self.gridLayout_62.setObjectName("gridLayout_62") - self.gridLayout_show_box = QtWidgets.QGridLayout() - self.gridLayout_show_box.setObjectName("gridLayout_show_box") - self.gridLayout_62.addLayout(self.gridLayout_show_box, 1, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_show_box, 16, 0, 1, 2) - self.groupBox_claude2 = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_claude2.setObjectName("groupBox_claude2") - self.gridLayout_65 = QtWidgets.QGridLayout(self.groupBox_claude2) - self.gridLayout_65.setObjectName("gridLayout_65") - self.gridLayout_60 = QtWidgets.QGridLayout() - self.gridLayout_60.setObjectName("gridLayout_60") - self.lineEdit_claude2_cookie = QtWidgets.QLineEdit(self.groupBox_claude2) - self.lineEdit_claude2_cookie.setObjectName("lineEdit_claude2_cookie") - self.gridLayout_60.addWidget(self.lineEdit_claude2_cookie, 0, 1, 1, 1) - self.lineEdit_claude2_proxies_socks5 = QtWidgets.QLineEdit(self.groupBox_claude2) - self.lineEdit_claude2_proxies_socks5.setObjectName("lineEdit_claude2_proxies_socks5") - self.gridLayout_60.addWidget(self.lineEdit_claude2_proxies_socks5, 4, 1, 1, 1) - self.label_claude2_proxies_https = QtWidgets.QLabel(self.groupBox_claude2) - self.label_claude2_proxies_https.setObjectName("label_claude2_proxies_https") - self.gridLayout_60.addWidget(self.label_claude2_proxies_https, 3, 0, 1, 1) - self.label_claude2_proxies_socks5 = QtWidgets.QLabel(self.groupBox_claude2) - self.label_claude2_proxies_socks5.setObjectName("label_claude2_proxies_socks5") - self.gridLayout_60.addWidget(self.label_claude2_proxies_socks5, 4, 0, 1, 1) - self.checkBox_claude2_use_proxy = QtWidgets.QCheckBox(self.groupBox_claude2) - self.checkBox_claude2_use_proxy.setObjectName("checkBox_claude2_use_proxy") - self.gridLayout_60.addWidget(self.checkBox_claude2_use_proxy, 1, 1, 1, 1) - self.label_claude2_cookie = QtWidgets.QLabel(self.groupBox_claude2) - self.label_claude2_cookie.setObjectName("label_claude2_cookie") - self.gridLayout_60.addWidget(self.label_claude2_cookie, 0, 0, 1, 1) - self.label_claude2_use_proxy = QtWidgets.QLabel(self.groupBox_claude2) - self.label_claude2_use_proxy.setObjectName("label_claude2_use_proxy") - self.gridLayout_60.addWidget(self.label_claude2_use_proxy, 1, 0, 1, 1) - self.label_claude2_proxies_http = QtWidgets.QLabel(self.groupBox_claude2) - self.label_claude2_proxies_http.setObjectName("label_claude2_proxies_http") - self.gridLayout_60.addWidget(self.label_claude2_proxies_http, 2, 0, 1, 1) - self.lineEdit_claude2_proxies_https = QtWidgets.QLineEdit(self.groupBox_claude2) - self.lineEdit_claude2_proxies_https.setObjectName("lineEdit_claude2_proxies_https") - self.gridLayout_60.addWidget(self.lineEdit_claude2_proxies_https, 3, 1, 1, 1) - self.lineEdit_claude2_proxies_http = QtWidgets.QLineEdit(self.groupBox_claude2) - self.lineEdit_claude2_proxies_http.setObjectName("lineEdit_claude2_proxies_http") - self.gridLayout_60.addWidget(self.lineEdit_claude2_proxies_http, 2, 1, 1, 1) - self.gridLayout_65.addLayout(self.gridLayout_60, 0, 0, 1, 1) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_65.addItem(spacerItem1, 0, 1, 1, 1) - self.gridLayout_65.setColumnStretch(0, 9) - self.gridLayout_65.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_claude2, 35, 0, 1, 3) - self.groupBox_xuniren = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_xuniren.setObjectName("groupBox_xuniren") - self.gridLayout_89 = QtWidgets.QGridLayout(self.groupBox_xuniren) - self.gridLayout_89.setObjectName("gridLayout_89") - self.gridLayout_xuniren = QtWidgets.QGridLayout() - self.gridLayout_xuniren.setObjectName("gridLayout_xuniren") - self.gridLayout_89.addLayout(self.gridLayout_xuniren, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_xuniren, 19, 0, 1, 2) - self.label_after_prompt = QtWidgets.QLabel(self.formWidget) - self.label_after_prompt.setObjectName("label_after_prompt") - self.gridLayout.addWidget(self.label_after_prompt, 6, 0, 1, 1) - self.groupBox_chatglm = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_chatglm.setObjectName("groupBox_chatglm") - self.gridLayout_9 = QtWidgets.QGridLayout(self.groupBox_chatglm) - self.gridLayout_9.setObjectName("gridLayout_9") - self.gridLayout_8 = QtWidgets.QGridLayout() - self.gridLayout_8.setObjectName("gridLayout_8") - self.label_chatglm_api_ip_port = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_api_ip_port.setObjectName("label_chatglm_api_ip_port") - self.gridLayout_8.addWidget(self.label_chatglm_api_ip_port, 0, 0, 1, 1) - self.lineEdit_chatglm_top_p = QtWidgets.QLineEdit(self.groupBox_chatglm) - self.lineEdit_chatglm_top_p.setObjectName("lineEdit_chatglm_top_p") - self.gridLayout_8.addWidget(self.lineEdit_chatglm_top_p, 2, 1, 1, 1) - self.label_chatglm_history_max_len = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_history_max_len.setObjectName("label_chatglm_history_max_len") - self.gridLayout_8.addWidget(self.label_chatglm_history_max_len, 5, 0, 1, 1) - self.lineEdit_chatglm_max_length = QtWidgets.QLineEdit(self.groupBox_chatglm) - self.lineEdit_chatglm_max_length.setObjectName("lineEdit_chatglm_max_length") - self.gridLayout_8.addWidget(self.lineEdit_chatglm_max_length, 1, 1, 1, 1) - self.label_chatglm_top_p = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_top_p.setObjectName("label_chatglm_top_p") - self.gridLayout_8.addWidget(self.label_chatglm_top_p, 2, 0, 1, 1) - self.label_chatglm_temperature = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_temperature.setObjectName("label_chatglm_temperature") - self.gridLayout_8.addWidget(self.label_chatglm_temperature, 3, 0, 1, 1) - self.lineEdit_chatglm_temperature = QtWidgets.QLineEdit(self.groupBox_chatglm) - self.lineEdit_chatglm_temperature.setObjectName("lineEdit_chatglm_temperature") - self.gridLayout_8.addWidget(self.lineEdit_chatglm_temperature, 3, 1, 1, 1) - self.lineEdit_chatglm_api_ip_port = QtWidgets.QLineEdit(self.groupBox_chatglm) - self.lineEdit_chatglm_api_ip_port.setObjectName("lineEdit_chatglm_api_ip_port") - self.gridLayout_8.addWidget(self.lineEdit_chatglm_api_ip_port, 0, 1, 1, 1) - self.label_chatglm_max_length = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_max_length.setObjectName("label_chatglm_max_length") - self.gridLayout_8.addWidget(self.label_chatglm_max_length, 1, 0, 1, 1) - self.label_chatglm_history_enable = QtWidgets.QLabel(self.groupBox_chatglm) - self.label_chatglm_history_enable.setObjectName("label_chatglm_history_enable") - self.gridLayout_8.addWidget(self.label_chatglm_history_enable, 4, 0, 1, 1) - self.checkBox_chatglm_history_enable = QtWidgets.QCheckBox(self.groupBox_chatglm) - self.checkBox_chatglm_history_enable.setObjectName("checkBox_chatglm_history_enable") - self.gridLayout_8.addWidget(self.checkBox_chatglm_history_enable, 4, 1, 1, 1) - self.lineEdit_chatglm_history_max_len = QtWidgets.QLineEdit(self.groupBox_chatglm) - self.lineEdit_chatglm_history_max_len.setObjectName("lineEdit_chatglm_history_max_len") - self.gridLayout_8.addWidget(self.lineEdit_chatglm_history_max_len, 5, 1, 1, 1) - self.gridLayout_9.addLayout(self.gridLayout_8, 0, 0, 1, 1) - spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_9.addItem(spacerItem2, 0, 1, 1, 1) - self.gridLayout_9.setColumnStretch(0, 9) - self.gridLayout_9.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_chatglm, 36, 0, 1, 3) - self.label_room_display_id = QtWidgets.QLabel(self.formWidget) - self.label_room_display_id.setObjectName("label_room_display_id") - self.gridLayout.addWidget(self.label_room_display_id, 1, 0, 1, 1) - self.groupBox_openai = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_openai.setObjectName("groupBox_openai") - self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_openai) - self.gridLayout_4.setObjectName("gridLayout_4") - self.gridLayout_2 = QtWidgets.QGridLayout() - self.gridLayout_2.setSpacing(2) - self.gridLayout_2.setObjectName("gridLayout_2") - self.label_openai_api = QtWidgets.QLabel(self.groupBox_openai) - self.label_openai_api.setObjectName("label_openai_api") - self.gridLayout_2.addWidget(self.label_openai_api, 0, 0, 1, 1) - self.lineEdit_openai_api = QtWidgets.QLineEdit(self.groupBox_openai) - self.lineEdit_openai_api.setObjectName("lineEdit_openai_api") - self.gridLayout_2.addWidget(self.lineEdit_openai_api, 0, 2, 1, 1) - self.label_openai_api_key = QtWidgets.QLabel(self.groupBox_openai) - self.label_openai_api_key.setObjectName("label_openai_api_key") - self.gridLayout_2.addWidget(self.label_openai_api_key, 1, 0, 1, 1) - self.textEdit_openai_api_key = QtWidgets.QTextEdit(self.groupBox_openai) - self.textEdit_openai_api_key.setObjectName("textEdit_openai_api_key") - self.gridLayout_2.addWidget(self.textEdit_openai_api_key, 1, 1, 1, 2) - self.gridLayout_4.addLayout(self.gridLayout_2, 0, 0, 1, 1) - spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_4.addItem(spacerItem3, 0, 1, 1, 1) - self.gridLayout_4.setColumnStretch(0, 9) - self.gridLayout_4.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_openai, 30, 0, 1, 3) - self.lineEdit_before_prompt = QtWidgets.QLineEdit(self.formWidget) - self.lineEdit_before_prompt.setObjectName("lineEdit_before_prompt") - self.gridLayout.addWidget(self.lineEdit_before_prompt, 5, 1, 1, 1) - self.label_visual_body = QtWidgets.QLabel(self.formWidget) - self.label_visual_body.setObjectName("label_visual_body") - self.gridLayout.addWidget(self.label_visual_body, 3, 0, 1, 1) - self.comboBox_platform = QtWidgets.QComboBox(self.formWidget) - self.comboBox_platform.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.comboBox_platform.setObjectName("comboBox_platform") - self.gridLayout.addWidget(self.comboBox_platform, 0, 1, 1, 1) - self.label_chat_type = QtWidgets.QLabel(self.formWidget) - self.label_chat_type.setObjectName("label_chat_type") - self.gridLayout.addWidget(self.label_chat_type, 2, 0, 1, 1) - self.groupBox_local_qa = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_local_qa.setObjectName("groupBox_local_qa") - self.gridLayout_51 = QtWidgets.QGridLayout(self.groupBox_local_qa) - self.gridLayout_51.setObjectName("gridLayout_51") - self.gridLayout_50 = QtWidgets.QGridLayout() - self.gridLayout_50.setObjectName("gridLayout_50") - self.label_local_qa_audio_enable = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_audio_enable.setObjectName("label_local_qa_audio_enable") - self.gridLayout_50.addWidget(self.label_local_qa_audio_enable, 4, 0, 1, 1) - self.label_local_qa_text_enable = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_text_enable.setObjectName("label_local_qa_text_enable") - self.gridLayout_50.addWidget(self.label_local_qa_text_enable, 0, 0, 1, 1) - self.checkBox_local_qa_text_enable = QtWidgets.QCheckBox(self.groupBox_local_qa) - self.checkBox_local_qa_text_enable.setObjectName("checkBox_local_qa_text_enable") - self.gridLayout_50.addWidget(self.checkBox_local_qa_text_enable, 0, 1, 1, 1) - self.lineEdit_local_qa_text_file_path = QtWidgets.QLineEdit(self.groupBox_local_qa) - self.lineEdit_local_qa_text_file_path.setObjectName("lineEdit_local_qa_text_file_path") - self.gridLayout_50.addWidget(self.lineEdit_local_qa_text_file_path, 2, 1, 1, 1) - self.label_local_qa_audio_similarity = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_audio_similarity.setObjectName("label_local_qa_audio_similarity") - self.gridLayout_50.addWidget(self.label_local_qa_audio_similarity, 6, 0, 1, 1) - self.checkBox_local_qa_audio_enable = QtWidgets.QCheckBox(self.groupBox_local_qa) - self.checkBox_local_qa_audio_enable.setObjectName("checkBox_local_qa_audio_enable") - self.gridLayout_50.addWidget(self.checkBox_local_qa_audio_enable, 4, 1, 1, 1) - self.label_local_qa_text_similarity = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_text_similarity.setObjectName("label_local_qa_text_similarity") - self.gridLayout_50.addWidget(self.label_local_qa_text_similarity, 3, 0, 1, 1) - self.lineEdit_local_qa_audio_file_path = QtWidgets.QLineEdit(self.groupBox_local_qa) - self.lineEdit_local_qa_audio_file_path.setObjectName("lineEdit_local_qa_audio_file_path") - self.gridLayout_50.addWidget(self.lineEdit_local_qa_audio_file_path, 5, 1, 1, 1) - self.label_local_qa_audio_file_path = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_audio_file_path.setObjectName("label_local_qa_audio_file_path") - self.gridLayout_50.addWidget(self.label_local_qa_audio_file_path, 5, 0, 1, 1) - self.label_local_qa_text_file_path = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_text_file_path.setObjectName("label_local_qa_text_file_path") - self.gridLayout_50.addWidget(self.label_local_qa_text_file_path, 2, 0, 1, 1) - self.lineEdit_local_qa_text_similarity = QtWidgets.QLineEdit(self.groupBox_local_qa) - self.lineEdit_local_qa_text_similarity.setObjectName("lineEdit_local_qa_text_similarity") - self.gridLayout_50.addWidget(self.lineEdit_local_qa_text_similarity, 3, 1, 1, 1) - self.lineEdit_local_qa_audio_similarity = QtWidgets.QLineEdit(self.groupBox_local_qa) - self.lineEdit_local_qa_audio_similarity.setObjectName("lineEdit_local_qa_audio_similarity") - self.gridLayout_50.addWidget(self.lineEdit_local_qa_audio_similarity, 6, 1, 1, 1) - self.label_local_qa_text_type = QtWidgets.QLabel(self.groupBox_local_qa) - self.label_local_qa_text_type.setObjectName("label_local_qa_text_type") - self.gridLayout_50.addWidget(self.label_local_qa_text_type, 1, 0, 1, 1) - self.comboBox_local_qa_text_type = QtWidgets.QComboBox(self.groupBox_local_qa) - self.comboBox_local_qa_text_type.setObjectName("comboBox_local_qa_text_type") - self.comboBox_local_qa_text_type.addItem("") - self.comboBox_local_qa_text_type.addItem("") - self.gridLayout_50.addWidget(self.comboBox_local_qa_text_type, 1, 1, 1, 1) - self.gridLayout_51.addLayout(self.gridLayout_50, 0, 0, 1, 1) - spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_51.addItem(spacerItem4, 0, 1, 1, 1) - self.gridLayout_51.setColumnStretch(0, 9) - self.gridLayout_51.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_local_qa, 23, 0, 1, 3) - self.groupBox_claude = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_claude.setObjectName("groupBox_claude") - self.gridLayout_7 = QtWidgets.QGridLayout(self.groupBox_claude) - self.gridLayout_7.setObjectName("gridLayout_7") - self.gridLayout_6 = QtWidgets.QGridLayout() - self.gridLayout_6.setObjectName("gridLayout_6") - self.lineEdit_claude_slack_user_token = QtWidgets.QLineEdit(self.groupBox_claude) - self.lineEdit_claude_slack_user_token.setObjectName("lineEdit_claude_slack_user_token") - self.gridLayout_6.addWidget(self.lineEdit_claude_slack_user_token, 1, 1, 1, 1) - self.label_claude_slack_user_token = QtWidgets.QLabel(self.groupBox_claude) - self.label_claude_slack_user_token.setObjectName("label_claude_slack_user_token") - self.gridLayout_6.addWidget(self.label_claude_slack_user_token, 1, 0, 1, 1) - self.label_claude_bot_user_id = QtWidgets.QLabel(self.groupBox_claude) - self.label_claude_bot_user_id.setObjectName("label_claude_bot_user_id") - self.gridLayout_6.addWidget(self.label_claude_bot_user_id, 2, 0, 1, 1) - self.lineEdit_claude_bot_user_id = QtWidgets.QLineEdit(self.groupBox_claude) - self.lineEdit_claude_bot_user_id.setObjectName("lineEdit_claude_bot_user_id") - self.gridLayout_6.addWidget(self.lineEdit_claude_bot_user_id, 2, 1, 1, 1) - self.gridLayout_7.addLayout(self.gridLayout_6, 0, 0, 1, 1) - spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_7.addItem(spacerItem5, 0, 1, 1, 1) - self.gridLayout_7.setColumnStretch(0, 9) - self.gridLayout_7.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_claude, 34, 0, 1, 3) - self.comboBox_need_lang = QtWidgets.QComboBox(self.formWidget) - self.comboBox_need_lang.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.comboBox_need_lang.setObjectName("comboBox_need_lang") - self.comboBox_need_lang.addItem("") - self.comboBox_need_lang.addItem("") - self.comboBox_need_lang.addItem("") - self.comboBox_need_lang.addItem("") - self.gridLayout.addWidget(self.comboBox_need_lang, 4, 1, 1, 1) - self.groupBox_log = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_log.setObjectName("groupBox_log") - self.gridLayout_47 = QtWidgets.QGridLayout(self.groupBox_log) - self.gridLayout_47.setObjectName("gridLayout_47") - self.gridLayout_46 = QtWidgets.QGridLayout() - self.gridLayout_46.setObjectName("gridLayout_46") - self.comboBox_comment_log_type = QtWidgets.QComboBox(self.groupBox_log) - self.comboBox_comment_log_type.setObjectName("comboBox_comment_log_type") - self.comboBox_comment_log_type.addItem("") - self.comboBox_comment_log_type.addItem("") - self.comboBox_comment_log_type.addItem("") - self.comboBox_comment_log_type.addItem("") - self.gridLayout_46.addWidget(self.comboBox_comment_log_type, 1, 1, 1, 1) - self.label_comment_log_type = QtWidgets.QLabel(self.groupBox_log) - self.label_comment_log_type.setObjectName("label_comment_log_type") - self.gridLayout_46.addWidget(self.label_comment_log_type, 1, 0, 1, 1) - self.label_captions_file_path = QtWidgets.QLabel(self.groupBox_log) - self.label_captions_file_path.setObjectName("label_captions_file_path") - self.gridLayout_46.addWidget(self.label_captions_file_path, 3, 0, 1, 1) - self.lineEdit_captions_file_path = QtWidgets.QLineEdit(self.groupBox_log) - self.lineEdit_captions_file_path.setObjectName("lineEdit_captions_file_path") - self.gridLayout_46.addWidget(self.lineEdit_captions_file_path, 3, 1, 1, 1) - self.label_captions_enable = QtWidgets.QLabel(self.groupBox_log) - self.label_captions_enable.setObjectName("label_captions_enable") - self.gridLayout_46.addWidget(self.label_captions_enable, 2, 0, 1, 1) - self.checkBox_captions_enable = QtWidgets.QCheckBox(self.groupBox_log) - self.checkBox_captions_enable.setObjectName("checkBox_captions_enable") - self.gridLayout_46.addWidget(self.checkBox_captions_enable, 2, 1, 1, 1) - self.gridLayout_46.setColumnStretch(0, 1) - self.gridLayout_46.setColumnStretch(1, 5) - self.gridLayout_47.addLayout(self.gridLayout_46, 0, 0, 1, 1) - spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_47.addItem(spacerItem6, 0, 1, 1, 1) - self.gridLayout_47.setColumnStretch(0, 9) - self.gridLayout_47.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_log, 22, 0, 1, 3) - spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout.addItem(spacerItem7, 0, 2, 1, 1) - self.groupBox_filter = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_filter.setStyleSheet("") - self.groupBox_filter.setObjectName("groupBox_filter") - self.gridLayout_26 = QtWidgets.QGridLayout(self.groupBox_filter) - self.gridLayout_26.setObjectName("gridLayout_26") - self.gridLayout_filter = QtWidgets.QGridLayout() - self.gridLayout_filter.setObjectName("gridLayout_filter") - self.label_filter_talk_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_talk_forget_reserve_num.setObjectName("label_filter_talk_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_talk_forget_reserve_num, 15, 0, 1, 1) - self.lineEdit_filter_talk_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_talk_forget_reserve_num.setObjectName("lineEdit_filter_talk_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_talk_forget_reserve_num, 15, 1, 1, 1) - self.lineEdit_filter_max_char_len = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_max_char_len.setObjectName("lineEdit_filter_max_char_len") - self.gridLayout_filter.addWidget(self.lineEdit_filter_max_char_len, 5, 1, 1, 1) - self.lineEdit_filter_comment_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_comment_forget_duration.setObjectName("lineEdit_filter_comment_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_comment_forget_duration, 6, 1, 1, 1) - self.lineEdit_filter_entrance_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_entrance_forget_duration.setObjectName("lineEdit_filter_entrance_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_entrance_forget_duration, 12, 1, 1, 1) - self.label_filter_comment_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_comment_forget_reserve_num.setObjectName("label_filter_comment_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_comment_forget_reserve_num, 7, 0, 1, 1) - self.label_filter_max_len = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_max_len.setObjectName("label_filter_max_len") - self.gridLayout_filter.addWidget(self.label_filter_max_len, 4, 0, 1, 1) - self.lineEdit_filter_badwords_path = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_badwords_path.setObjectName("lineEdit_filter_badwords_path") - self.gridLayout_filter.addWidget(self.lineEdit_filter_badwords_path, 2, 1, 1, 1) - self.label_filter_max_char_len = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_max_char_len.setObjectName("label_filter_max_char_len") - self.gridLayout_filter.addWidget(self.label_filter_max_char_len, 5, 0, 1, 1) - self.lineEdit_filter_max_len = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_max_len.setObjectName("lineEdit_filter_max_len") - self.gridLayout_filter.addWidget(self.lineEdit_filter_max_len, 4, 1, 1, 1) - self.lineEdit_filter_gift_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_gift_forget_duration.setObjectName("lineEdit_filter_gift_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_gift_forget_duration, 8, 1, 1, 1) - self.label_filter_entrance_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_entrance_forget_reserve_num.setObjectName("label_filter_entrance_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_entrance_forget_reserve_num, 13, 0, 1, 1) - self.label_filter_talk_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_talk_forget_duration.setObjectName("label_filter_talk_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_talk_forget_duration, 14, 0, 1, 1) - self.label_filter_badwords_path = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_badwords_path.setObjectName("label_filter_badwords_path") - self.gridLayout_filter.addWidget(self.label_filter_badwords_path, 2, 0, 1, 1) - self.label_filter_schedule_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_schedule_forget_duration.setObjectName("label_filter_schedule_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_schedule_forget_duration, 16, 0, 1, 1) - self.label_filter_comment_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_comment_forget_duration.setObjectName("label_filter_comment_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_comment_forget_duration, 6, 0, 1, 1) - self.lineEdit_filter_schedule_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_schedule_forget_duration.setObjectName("lineEdit_filter_schedule_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_schedule_forget_duration, 16, 1, 1, 1) - self.lineEdit_filter_gift_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_gift_forget_reserve_num.setObjectName("lineEdit_filter_gift_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_gift_forget_reserve_num, 9, 1, 1, 1) - self.label_filter_follow_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_follow_forget_duration.setObjectName("label_filter_follow_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_follow_forget_duration, 10, 0, 1, 1) - self.lineEdit_filter_entrance_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_entrance_forget_reserve_num.setObjectName("lineEdit_filter_entrance_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_entrance_forget_reserve_num, 13, 1, 1, 1) - self.label_filter_bad_pinyin_path = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_bad_pinyin_path.setObjectName("label_filter_bad_pinyin_path") - self.gridLayout_filter.addWidget(self.label_filter_bad_pinyin_path, 3, 0, 1, 1) - self.textEdit_filter_after_must_str = QtWidgets.QTextEdit(self.groupBox_filter) - self.textEdit_filter_after_must_str.setObjectName("textEdit_filter_after_must_str") - self.gridLayout_filter.addWidget(self.textEdit_filter_after_must_str, 1, 1, 1, 1) - self.textEdit_filter_before_must_str = QtWidgets.QTextEdit(self.groupBox_filter) - self.textEdit_filter_before_must_str.setObjectName("textEdit_filter_before_must_str") - self.gridLayout_filter.addWidget(self.textEdit_filter_before_must_str, 0, 1, 1, 1) - self.label_filter_gift_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_gift_forget_reserve_num.setObjectName("label_filter_gift_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_gift_forget_reserve_num, 9, 0, 1, 1) - self.lineEdit_filter_bad_pinyin_path = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_bad_pinyin_path.setObjectName("lineEdit_filter_bad_pinyin_path") - self.gridLayout_filter.addWidget(self.lineEdit_filter_bad_pinyin_path, 3, 1, 1, 1) - self.label_filter_before_must_str = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_before_must_str.setObjectName("label_filter_before_must_str") - self.gridLayout_filter.addWidget(self.label_filter_before_must_str, 0, 0, 1, 1) - self.lineEdit_filter_talk_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_talk_forget_duration.setObjectName("lineEdit_filter_talk_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_talk_forget_duration, 14, 1, 1, 1) - self.label_filter_after_must_str = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_after_must_str.setObjectName("label_filter_after_must_str") - self.gridLayout_filter.addWidget(self.label_filter_after_must_str, 1, 0, 1, 1) - self.lineEdit_filter_comment_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_comment_forget_reserve_num.setObjectName("lineEdit_filter_comment_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_comment_forget_reserve_num, 7, 1, 1, 1) - self.label_filter_schedule_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_schedule_forget_reserve_num.setObjectName("label_filter_schedule_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_schedule_forget_reserve_num, 17, 0, 1, 1) - self.label_filter_gift_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_gift_forget_duration.setObjectName("label_filter_gift_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_gift_forget_duration, 8, 0, 1, 1) - self.lineEdit_filter_schedule_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_schedule_forget_reserve_num.setObjectName("lineEdit_filter_schedule_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_schedule_forget_reserve_num, 17, 1, 1, 1) - self.label_filter_entrance_forget_duration = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_entrance_forget_duration.setObjectName("label_filter_entrance_forget_duration") - self.gridLayout_filter.addWidget(self.label_filter_entrance_forget_duration, 12, 0, 1, 1) - self.label_filter_follow_forget_reserve_num = QtWidgets.QLabel(self.groupBox_filter) - self.label_filter_follow_forget_reserve_num.setObjectName("label_filter_follow_forget_reserve_num") - self.gridLayout_filter.addWidget(self.label_filter_follow_forget_reserve_num, 11, 0, 1, 1) - self.lineEdit_filter_follow_forget_duration = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_follow_forget_duration.setObjectName("lineEdit_filter_follow_forget_duration") - self.gridLayout_filter.addWidget(self.lineEdit_filter_follow_forget_duration, 10, 1, 1, 1) - self.lineEdit_filter_follow_forget_reserve_num = QtWidgets.QLineEdit(self.groupBox_filter) - self.lineEdit_filter_follow_forget_reserve_num.setObjectName("lineEdit_filter_follow_forget_reserve_num") - self.gridLayout_filter.addWidget(self.lineEdit_filter_follow_forget_reserve_num, 11, 1, 1, 1) - self.gridLayout_26.addLayout(self.gridLayout_filter, 0, 0, 1, 1) - spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_26.addItem(spacerItem8, 0, 1, 1, 1) - self.gridLayout_26.setColumnStretch(0, 9) - self.gridLayout_26.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_filter, 24, 0, 1, 3) - self.groupBox_twitch = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_twitch.setObjectName("groupBox_twitch") - self.gridLayout_91 = QtWidgets.QGridLayout(self.groupBox_twitch) - self.gridLayout_91.setObjectName("gridLayout_91") - self.gridLayout_twitch = QtWidgets.QGridLayout() - self.gridLayout_twitch.setObjectName("gridLayout_twitch") - self.gridLayout_91.addLayout(self.gridLayout_twitch, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_twitch, 13, 0, 1, 2) - self.label_audio_synthesis_type = QtWidgets.QLabel(self.formWidget) - self.label_audio_synthesis_type.setObjectName("label_audio_synthesis_type") - self.gridLayout.addWidget(self.label_audio_synthesis_type, 11, 0, 1, 1) - self.lineEdit_after_prompt = QtWidgets.QLineEdit(self.formWidget) - self.lineEdit_after_prompt.setObjectName("lineEdit_after_prompt") - self.gridLayout.addWidget(self.lineEdit_after_prompt, 6, 1, 1, 1) - self.comboBox_chat_type = QtWidgets.QComboBox(self.formWidget) - self.comboBox_chat_type.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.comboBox_chat_type.setObjectName("comboBox_chat_type") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.comboBox_chat_type.addItem("") - self.gridLayout.addWidget(self.comboBox_chat_type, 2, 1, 1, 1) - self.lineEdit_room_display_id = QtWidgets.QLineEdit(self.formWidget) - self.lineEdit_room_display_id.setObjectName("lineEdit_room_display_id") - self.gridLayout.addWidget(self.lineEdit_room_display_id, 1, 1, 1, 1) - self.groupBox_bilibili = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_bilibili.setObjectName("groupBox_bilibili") - self.gridLayout_72 = QtWidgets.QGridLayout(self.groupBox_bilibili) - self.gridLayout_72.setObjectName("gridLayout_72") - self.gridLayout_bilibili = QtWidgets.QGridLayout() - self.gridLayout_bilibili.setObjectName("gridLayout_bilibili") - self.gridLayout_72.addLayout(self.gridLayout_bilibili, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_bilibili, 12, 0, 1, 2) - self.comboBox_visual_body = QtWidgets.QComboBox(self.formWidget) - self.comboBox_visual_body.setObjectName("comboBox_visual_body") - self.gridLayout.addWidget(self.comboBox_visual_body, 3, 1, 1, 1) - self.groupBox_thanks = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_thanks.setObjectName("groupBox_thanks") - self.gridLayout_42 = QtWidgets.QGridLayout(self.groupBox_thanks) - self.gridLayout_42.setObjectName("gridLayout_42") - self.label_thanks_follow_enable = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_follow_enable.setObjectName("label_thanks_follow_enable") - self.gridLayout_42.addWidget(self.label_thanks_follow_enable, 6, 0, 1, 1) - self.label_thanks_entrance_enable = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_entrance_enable.setObjectName("label_thanks_entrance_enable") - self.gridLayout_42.addWidget(self.label_thanks_entrance_enable, 0, 0, 1, 1) - self.label_thanks_entrance_copy = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_entrance_copy.setObjectName("label_thanks_entrance_copy") - self.gridLayout_42.addWidget(self.label_thanks_entrance_copy, 2, 0, 1, 1) - self.lineEdit_thanks_lowest_price = QtWidgets.QLineEdit(self.groupBox_thanks) - self.lineEdit_thanks_lowest_price.setObjectName("lineEdit_thanks_lowest_price") - self.gridLayout_42.addWidget(self.lineEdit_thanks_lowest_price, 5, 1, 1, 1) - self.label_thanks_follow_copy = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_follow_copy.setObjectName("label_thanks_follow_copy") - self.gridLayout_42.addWidget(self.label_thanks_follow_copy, 7, 0, 1, 1) - self.label_thanks_gift_copy = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_gift_copy.setObjectName("label_thanks_gift_copy") - self.gridLayout_42.addWidget(self.label_thanks_gift_copy, 4, 0, 1, 1) - self.label_thanks_gift_enable = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_gift_enable.setObjectName("label_thanks_gift_enable") - self.gridLayout_42.addWidget(self.label_thanks_gift_enable, 3, 0, 1, 1) - self.lineEdit_thanks_follow_copy = QtWidgets.QLineEdit(self.groupBox_thanks) - self.lineEdit_thanks_follow_copy.setObjectName("lineEdit_thanks_follow_copy") - self.gridLayout_42.addWidget(self.lineEdit_thanks_follow_copy, 7, 1, 1, 1) - spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_42.addItem(spacerItem9, 2, 2, 1, 1) - self.checkBox_thanks_gift_enable = QtWidgets.QCheckBox(self.groupBox_thanks) - self.checkBox_thanks_gift_enable.setObjectName("checkBox_thanks_gift_enable") - self.gridLayout_42.addWidget(self.checkBox_thanks_gift_enable, 3, 1, 1, 1) - self.lineEdit_thanks_entrance_copy = QtWidgets.QLineEdit(self.groupBox_thanks) - self.lineEdit_thanks_entrance_copy.setObjectName("lineEdit_thanks_entrance_copy") - self.gridLayout_42.addWidget(self.lineEdit_thanks_entrance_copy, 2, 1, 1, 1) - self.label_thanks_lowest_price = QtWidgets.QLabel(self.groupBox_thanks) - self.label_thanks_lowest_price.setObjectName("label_thanks_lowest_price") - self.gridLayout_42.addWidget(self.label_thanks_lowest_price, 5, 0, 1, 1) - self.lineEdit_thanks_gift_copy = QtWidgets.QLineEdit(self.groupBox_thanks) - self.lineEdit_thanks_gift_copy.setObjectName("lineEdit_thanks_gift_copy") - self.gridLayout_42.addWidget(self.lineEdit_thanks_gift_copy, 4, 1, 1, 1) - self.checkBox_thanks_entrance_enable = QtWidgets.QCheckBox(self.groupBox_thanks) - self.checkBox_thanks_entrance_enable.setObjectName("checkBox_thanks_entrance_enable") - self.gridLayout_42.addWidget(self.checkBox_thanks_entrance_enable, 0, 1, 1, 1) - self.checkBox_thanks_follow_enable = QtWidgets.QCheckBox(self.groupBox_thanks) - self.checkBox_thanks_follow_enable.setObjectName("checkBox_thanks_follow_enable") - self.gridLayout_42.addWidget(self.checkBox_thanks_follow_enable, 6, 1, 1, 1) - self.gridLayout_42.setColumnStretch(0, 1) - self.gridLayout_42.setColumnStretch(1, 8) - self.gridLayout_42.setColumnStretch(2, 1) - self.gridLayout.addWidget(self.groupBox_thanks, 26, 0, 1, 3) - self.groupBox_chatgpt = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_chatgpt.setObjectName("groupBox_chatgpt") - self.gridLayout_5 = QtWidgets.QGridLayout(self.groupBox_chatgpt) - self.gridLayout_5.setObjectName("gridLayout_5") - self.gridLayout_3 = QtWidgets.QGridLayout() - self.gridLayout_3.setObjectName("gridLayout_3") - self.lineEdit_chatgpt_max_tokens = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_max_tokens.setObjectName("lineEdit_chatgpt_max_tokens") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_max_tokens, 2, 1, 1, 1) - self.label_chatgpt_model = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_model.setObjectName("label_chatgpt_model") - self.gridLayout_3.addWidget(self.label_chatgpt_model, 0, 0, 1, 1) - self.label_chatgpt_max_tokens = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_max_tokens.setObjectName("label_chatgpt_max_tokens") - self.gridLayout_3.addWidget(self.label_chatgpt_max_tokens, 2, 0, 1, 1) - self.lineEdit_chatgpt_presence_penalty = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_presence_penalty.setObjectName("lineEdit_chatgpt_presence_penalty") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_presence_penalty, 4, 1, 1, 1) - self.label_chatgpt_temperature = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_temperature.setObjectName("label_chatgpt_temperature") - self.gridLayout_3.addWidget(self.label_chatgpt_temperature, 1, 0, 1, 1) - self.label_chatgpt_top_p = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_top_p.setObjectName("label_chatgpt_top_p") - self.gridLayout_3.addWidget(self.label_chatgpt_top_p, 3, 0, 1, 1) - self.lineEdit_chatgpt_top_p = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_top_p.setObjectName("lineEdit_chatgpt_top_p") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_top_p, 3, 1, 1, 1) - self.lineEdit_chatgpt_temperature = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_temperature.setObjectName("lineEdit_chatgpt_temperature") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_temperature, 1, 1, 1, 1) - self.label_chatgpt_frequency_penalty = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_frequency_penalty.setObjectName("label_chatgpt_frequency_penalty") - self.gridLayout_3.addWidget(self.label_chatgpt_frequency_penalty, 5, 0, 1, 1) - self.lineEdit_chatgpt_frequency_penalty = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_frequency_penalty.setObjectName("lineEdit_chatgpt_frequency_penalty") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_frequency_penalty, 5, 1, 1, 1) - self.label_chatgpt_presence_penalty = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_presence_penalty.setObjectName("label_chatgpt_presence_penalty") - self.gridLayout_3.addWidget(self.label_chatgpt_presence_penalty, 4, 0, 1, 1) - self.label_chatgpt_preset = QtWidgets.QLabel(self.groupBox_chatgpt) - self.label_chatgpt_preset.setObjectName("label_chatgpt_preset") - self.gridLayout_3.addWidget(self.label_chatgpt_preset, 6, 0, 1, 1) - self.lineEdit_chatgpt_preset = QtWidgets.QLineEdit(self.groupBox_chatgpt) - self.lineEdit_chatgpt_preset.setObjectName("lineEdit_chatgpt_preset") - self.gridLayout_3.addWidget(self.lineEdit_chatgpt_preset, 6, 1, 1, 1) - self.comboBox_chatgpt_model = QtWidgets.QComboBox(self.groupBox_chatgpt) - self.comboBox_chatgpt_model.setObjectName("comboBox_chatgpt_model") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.comboBox_chatgpt_model.addItem("") - self.gridLayout_3.addWidget(self.comboBox_chatgpt_model, 0, 1, 1, 1) - self.gridLayout_5.addLayout(self.gridLayout_3, 0, 0, 1, 1) - spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_5.addItem(spacerItem10, 0, 1, 1, 1) - self.gridLayout_5.setColumnStretch(0, 9) - self.gridLayout_5.setColumnStretch(1, 1) - self.gridLayout.addWidget(self.groupBox_chatgpt, 32, 0, 2, 3) - self.groupBox_audio_player = QtWidgets.QGroupBox(self.formWidget) - self.groupBox_audio_player.setObjectName("groupBox_audio_player") - self.gridLayout_92 = QtWidgets.QGridLayout(self.groupBox_audio_player) - self.gridLayout_92.setObjectName("gridLayout_92") - self.gridLayout_audio_player = QtWidgets.QGridLayout() - self.gridLayout_audio_player.setObjectName("gridLayout_audio_player") - self.gridLayout_92.addLayout(self.gridLayout_audio_player, 0, 0, 1, 1) - self.gridLayout.addWidget(self.groupBox_audio_player, 18, 0, 1, 2) - self.gridLayout.setColumnStretch(0, 1) - self.gridLayout.setColumnStretch(1, 8) - self.gridLayout.setColumnStretch(2, 1) - self.verticalLayout.addWidget(self.formWidget) - self.groupBox_zhipu = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_zhipu.setObjectName("groupBox_zhipu") - self.gridLayout_71 = QtWidgets.QGridLayout(self.groupBox_zhipu) - self.gridLayout_71.setObjectName("gridLayout_71") - self.gridLayout_zhipu = QtWidgets.QGridLayout() - self.gridLayout_zhipu.setObjectName("gridLayout_zhipu") - self.gridLayout_71.addLayout(self.gridLayout_zhipu, 0, 0, 1, 1) - spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_71.addItem(spacerItem11, 0, 1, 1, 1) - self.gridLayout_71.setColumnStretch(0, 9) - self.gridLayout_71.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_zhipu) - self.groupBox_langchain_chatglm = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_langchain_chatglm.setObjectName("groupBox_langchain_chatglm") - self.gridLayout_64 = QtWidgets.QGridLayout(self.groupBox_langchain_chatglm) - self.gridLayout_64.setObjectName("gridLayout_64") - self.gridLayout_langchain_chatglm = QtWidgets.QGridLayout() - self.gridLayout_langchain_chatglm.setObjectName("gridLayout_langchain_chatglm") - self.label_langchain_chatglm_api_ip_port = QtWidgets.QLabel(self.groupBox_langchain_chatglm) - self.label_langchain_chatglm_api_ip_port.setObjectName("label_langchain_chatglm_api_ip_port") - self.gridLayout_langchain_chatglm.addWidget(self.label_langchain_chatglm_api_ip_port, 0, 0, 1, 1) - self.comboBox_langchain_chatglm_chat_type = QtWidgets.QComboBox(self.groupBox_langchain_chatglm) - self.comboBox_langchain_chatglm_chat_type.setObjectName("comboBox_langchain_chatglm_chat_type") - self.gridLayout_langchain_chatglm.addWidget(self.comboBox_langchain_chatglm_chat_type, 1, 1, 1, 1) - self.label_langchain_chatglm_chat_type = QtWidgets.QLabel(self.groupBox_langchain_chatglm) - self.label_langchain_chatglm_chat_type.setObjectName("label_langchain_chatglm_chat_type") - self.gridLayout_langchain_chatglm.addWidget(self.label_langchain_chatglm_chat_type, 1, 0, 1, 1) - self.label_langchain_chatglm_history_enable = QtWidgets.QLabel(self.groupBox_langchain_chatglm) - self.label_langchain_chatglm_history_enable.setObjectName("label_langchain_chatglm_history_enable") - self.gridLayout_langchain_chatglm.addWidget(self.label_langchain_chatglm_history_enable, 3, 0, 1, 1) - self.lineEdit_langchain_chatglm_knowledge_base_id = QtWidgets.QLineEdit(self.groupBox_langchain_chatglm) - self.lineEdit_langchain_chatglm_knowledge_base_id.setObjectName("lineEdit_langchain_chatglm_knowledge_base_id") - self.gridLayout_langchain_chatglm.addWidget(self.lineEdit_langchain_chatglm_knowledge_base_id, 2, 1, 1, 1) - self.checkBox_langchain_chatglm_history_enable = QtWidgets.QCheckBox(self.groupBox_langchain_chatglm) - self.checkBox_langchain_chatglm_history_enable.setObjectName("checkBox_langchain_chatglm_history_enable") - self.gridLayout_langchain_chatglm.addWidget(self.checkBox_langchain_chatglm_history_enable, 3, 1, 1, 1) - self.lineEdit_langchain_chatglm_api_ip_port = QtWidgets.QLineEdit(self.groupBox_langchain_chatglm) - self.lineEdit_langchain_chatglm_api_ip_port.setObjectName("lineEdit_langchain_chatglm_api_ip_port") - self.gridLayout_langchain_chatglm.addWidget(self.lineEdit_langchain_chatglm_api_ip_port, 0, 1, 1, 1) - self.label_langchain_chatglm_knowledge_base_id = QtWidgets.QLabel(self.groupBox_langchain_chatglm) - self.label_langchain_chatglm_knowledge_base_id.setObjectName("label_langchain_chatglm_knowledge_base_id") - self.gridLayout_langchain_chatglm.addWidget(self.label_langchain_chatglm_knowledge_base_id, 2, 0, 1, 1) - self.label_langchain_chatglm_history_max_len = QtWidgets.QLabel(self.groupBox_langchain_chatglm) - self.label_langchain_chatglm_history_max_len.setObjectName("label_langchain_chatglm_history_max_len") - self.gridLayout_langchain_chatglm.addWidget(self.label_langchain_chatglm_history_max_len, 4, 0, 1, 1) - self.lineEdit_langchain_chatglm_history_max_len = QtWidgets.QLineEdit(self.groupBox_langchain_chatglm) - self.lineEdit_langchain_chatglm_history_max_len.setObjectName("lineEdit_langchain_chatglm_history_max_len") - self.gridLayout_langchain_chatglm.addWidget(self.lineEdit_langchain_chatglm_history_max_len, 4, 1, 1, 1) - self.gridLayout_64.addLayout(self.gridLayout_langchain_chatglm, 0, 0, 1, 1) - spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_64.addItem(spacerItem12, 0, 1, 1, 1) - self.gridLayout_64.setColumnStretch(0, 9) - self.gridLayout_64.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_langchain_chatglm) - self.groupBox_chat_with_file = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_chat_with_file.setObjectName("groupBox_chat_with_file") - self.gridLayout_10 = QtWidgets.QGridLayout(self.groupBox_chat_with_file) - self.gridLayout_10.setObjectName("gridLayout_10") - self.gridLayout_11 = QtWidgets.QGridLayout() - self.gridLayout_11.setSpacing(6) - self.gridLayout_11.setObjectName("gridLayout_11") - self.label_chat_with_file_local_vector_embedding_model = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_local_vector_embedding_model.setObjectName("label_chat_with_file_local_vector_embedding_model") - self.gridLayout_11.addWidget(self.label_chat_with_file_local_vector_embedding_model, 6, 0, 1, 1) - self.label_chat_with_file_data_path = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_data_path.setObjectName("label_chat_with_file_data_path") - self.gridLayout_11.addWidget(self.label_chat_with_file_data_path, 1, 0, 1, 1) - self.label_chat_with_file_show_token_cost = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_show_token_cost.setObjectName("label_chat_with_file_show_token_cost") - self.gridLayout_11.addWidget(self.label_chat_with_file_show_token_cost, 10, 0, 1, 1) - self.label_chat_with_file_chat_mode = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_chat_mode.setObjectName("label_chat_with_file_chat_mode") - self.gridLayout_11.addWidget(self.label_chat_with_file_chat_mode, 0, 0, 1, 1) - self.label_chat_with_file_local_max_query = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_local_max_query.setObjectName("label_chat_with_file_local_max_query") - self.gridLayout_11.addWidget(self.label_chat_with_file_local_max_query, 9, 0, 1, 1) - self.label_chat_with_file_question_prompt = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_question_prompt.setObjectName("label_chat_with_file_question_prompt") - self.gridLayout_11.addWidget(self.label_chat_with_file_question_prompt, 8, 0, 1, 1) - self.lineEdit_chat_with_file_separator = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_separator.setObjectName("lineEdit_chat_with_file_separator") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_separator, 2, 1, 1, 1) - self.label_chat_with_file_chunk_size = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_chunk_size.setObjectName("label_chat_with_file_chunk_size") - self.gridLayout_11.addWidget(self.label_chat_with_file_chunk_size, 3, 0, 1, 1) - self.lineEdit_chat_with_file_chunk_overlap = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_chunk_overlap.setObjectName("lineEdit_chat_with_file_chunk_overlap") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_chunk_overlap, 5, 1, 1, 1) - self.label_chat_with_file_chain_type = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_chain_type.setObjectName("label_chat_with_file_chain_type") - self.gridLayout_11.addWidget(self.label_chat_with_file_chain_type, 7, 0, 1, 1) - self.checkBox_chat_with_file_show_token_cost = QtWidgets.QCheckBox(self.groupBox_chat_with_file) - self.checkBox_chat_with_file_show_token_cost.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.checkBox_chat_with_file_show_token_cost.setObjectName("checkBox_chat_with_file_show_token_cost") - self.gridLayout_11.addWidget(self.checkBox_chat_with_file_show_token_cost, 10, 1, 1, 1) - self.lineEdit_chat_with_file_data_path = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_data_path.setObjectName("lineEdit_chat_with_file_data_path") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_data_path, 1, 1, 1, 1) - self.comboBox_chat_with_file_chat_mode = QtWidgets.QComboBox(self.groupBox_chat_with_file) - self.comboBox_chat_with_file_chat_mode.setObjectName("comboBox_chat_with_file_chat_mode") - self.comboBox_chat_with_file_chat_mode.addItem("") - self.comboBox_chat_with_file_chat_mode.addItem("") - self.comboBox_chat_with_file_chat_mode.addItem("") - self.gridLayout_11.addWidget(self.comboBox_chat_with_file_chat_mode, 0, 1, 1, 1) - self.lineEdit_chat_with_file_question_prompt = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_question_prompt.setObjectName("lineEdit_chat_with_file_question_prompt") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_question_prompt, 8, 1, 1, 1) - self.label_chat_with_file_separator = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_separator.setObjectName("label_chat_with_file_separator") - self.gridLayout_11.addWidget(self.label_chat_with_file_separator, 2, 0, 1, 1) - self.lineEdit_chat_with_file_chain_type = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_chain_type.setObjectName("lineEdit_chat_with_file_chain_type") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_chain_type, 7, 1, 1, 1) - self.label_chat_with_file_chunk_overlap = QtWidgets.QLabel(self.groupBox_chat_with_file) - self.label_chat_with_file_chunk_overlap.setObjectName("label_chat_with_file_chunk_overlap") - self.gridLayout_11.addWidget(self.label_chat_with_file_chunk_overlap, 5, 0, 1, 1) - self.comboBox_chat_with_file_local_vector_embedding_model = QtWidgets.QComboBox(self.groupBox_chat_with_file) - self.comboBox_chat_with_file_local_vector_embedding_model.setObjectName("comboBox_chat_with_file_local_vector_embedding_model") - self.comboBox_chat_with_file_local_vector_embedding_model.addItem("") - self.comboBox_chat_with_file_local_vector_embedding_model.addItem("") - self.gridLayout_11.addWidget(self.comboBox_chat_with_file_local_vector_embedding_model, 6, 1, 1, 1) - self.lineEdit_chat_with_file_local_max_query = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_local_max_query.setObjectName("lineEdit_chat_with_file_local_max_query") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_local_max_query, 9, 1, 1, 1) - self.lineEdit_chat_with_file_chunk_size = QtWidgets.QLineEdit(self.groupBox_chat_with_file) - self.lineEdit_chat_with_file_chunk_size.setObjectName("lineEdit_chat_with_file_chunk_size") - self.gridLayout_11.addWidget(self.lineEdit_chat_with_file_chunk_size, 3, 1, 1, 1) - self.gridLayout_11.setColumnStretch(0, 1) - self.gridLayout_10.addLayout(self.gridLayout_11, 0, 0, 1, 1) - spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_10.addItem(spacerItem13, 0, 1, 1, 1) - self.gridLayout_10.setColumnStretch(0, 9) - self.gridLayout_10.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_chat_with_file) - self.groupBox_text_generation_webui = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_text_generation_webui.setObjectName("groupBox_text_generation_webui") - self.gridLayout_28 = QtWidgets.QGridLayout(self.groupBox_text_generation_webui) - self.gridLayout_28.setObjectName("gridLayout_28") - self.gridLayout_27 = QtWidgets.QGridLayout() - self.gridLayout_27.setObjectName("gridLayout_27") - self.lineEdit_text_generation_webui_api_ip_port = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_api_ip_port.setObjectName("lineEdit_text_generation_webui_api_ip_port") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_api_ip_port, 1, 1, 1, 1) - self.lineEdit_text_generation_webui_mode = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_mode.setObjectName("lineEdit_text_generation_webui_mode") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_mode, 3, 1, 1, 1) - self.lineEdit_text_generation_webui_instruction_template = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_instruction_template.setObjectName("lineEdit_text_generation_webui_instruction_template") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_instruction_template, 5, 1, 1, 1) - self.lineEdit_text_generation_webui_max_new_tokens = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_max_new_tokens.setObjectName("lineEdit_text_generation_webui_max_new_tokens") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_max_new_tokens, 2, 1, 1, 1) - self.label_text_generation_webui_max_new_tokens = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_max_new_tokens.setObjectName("label_text_generation_webui_max_new_tokens") - self.gridLayout_27.addWidget(self.label_text_generation_webui_max_new_tokens, 2, 0, 1, 1) - self.label_text_generation_webui_character = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_character.setObjectName("label_text_generation_webui_character") - self.gridLayout_27.addWidget(self.label_text_generation_webui_character, 4, 0, 1, 1) - self.label_text_generation_webui_api_ip_port = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_api_ip_port.setObjectName("label_text_generation_webui_api_ip_port") - self.gridLayout_27.addWidget(self.label_text_generation_webui_api_ip_port, 1, 0, 1, 1) - self.lineEdit_text_generation_webui_character = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_character.setObjectName("lineEdit_text_generation_webui_character") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_character, 4, 1, 1, 1) - self.label_text_generation_webui_instruction_template = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_instruction_template.setObjectName("label_text_generation_webui_instruction_template") - self.gridLayout_27.addWidget(self.label_text_generation_webui_instruction_template, 5, 0, 1, 1) - self.label_text_generation_webui_mode = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_mode.setObjectName("label_text_generation_webui_mode") - self.gridLayout_27.addWidget(self.label_text_generation_webui_mode, 3, 0, 1, 1) - self.label_text_generation_webui_your_name = QtWidgets.QLabel(self.groupBox_text_generation_webui) - self.label_text_generation_webui_your_name.setObjectName("label_text_generation_webui_your_name") - self.gridLayout_27.addWidget(self.label_text_generation_webui_your_name, 6, 0, 1, 1) - self.lineEdit_text_generation_webui_your_name = QtWidgets.QLineEdit(self.groupBox_text_generation_webui) - self.lineEdit_text_generation_webui_your_name.setObjectName("lineEdit_text_generation_webui_your_name") - self.gridLayout_27.addWidget(self.lineEdit_text_generation_webui_your_name, 6, 1, 1, 1) - self.gridLayout_28.addLayout(self.gridLayout_27, 0, 0, 1, 1) - spacerItem14 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_28.addItem(spacerItem14, 0, 1, 1, 1) - self.gridLayout_28.setColumnStretch(0, 9) - self.gridLayout_28.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_text_generation_webui) - self.groupBox_sparkdesk = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_sparkdesk.setObjectName("groupBox_sparkdesk") - self.gridLayout_55 = QtWidgets.QGridLayout(self.groupBox_sparkdesk) - self.gridLayout_55.setObjectName("gridLayout_55") - self.gridLayout_54 = QtWidgets.QGridLayout() - self.gridLayout_54.setObjectName("gridLayout_54") - self.label_sparkdesk_api_key = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_api_key.setObjectName("label_sparkdesk_api_key") - self.gridLayout_54.addWidget(self.label_sparkdesk_api_key, 6, 0, 1, 1) - self.lineEdit_sparkdesk_app_id = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_app_id.setObjectName("lineEdit_sparkdesk_app_id") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_app_id, 4, 1, 1, 1) - self.label_sparkdesk_api_secret = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_api_secret.setObjectName("label_sparkdesk_api_secret") - self.gridLayout_54.addWidget(self.label_sparkdesk_api_secret, 5, 0, 1, 1) - self.lineEdit_sparkdesk_GtToken = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_GtToken.setObjectName("lineEdit_sparkdesk_GtToken") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_GtToken, 3, 1, 1, 1) - self.lineEdit_sparkdesk_cookie = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_cookie.setObjectName("lineEdit_sparkdesk_cookie") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_cookie, 1, 1, 1, 1) - self.comboBox_sparkdesk_type = QtWidgets.QComboBox(self.groupBox_sparkdesk) - self.comboBox_sparkdesk_type.setObjectName("comboBox_sparkdesk_type") - self.gridLayout_54.addWidget(self.comboBox_sparkdesk_type, 0, 1, 1, 1) - self.label_sparkdesk_cookie = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_cookie.setObjectName("label_sparkdesk_cookie") - self.gridLayout_54.addWidget(self.label_sparkdesk_cookie, 1, 0, 1, 1) - self.label_sparkdesk_type = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_type.setObjectName("label_sparkdesk_type") - self.gridLayout_54.addWidget(self.label_sparkdesk_type, 0, 0, 1, 1) - self.label_sparkdesk_app_id = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_app_id.setObjectName("label_sparkdesk_app_id") - self.gridLayout_54.addWidget(self.label_sparkdesk_app_id, 4, 0, 1, 1) - self.lineEdit_sparkdesk_fd = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_fd.setObjectName("lineEdit_sparkdesk_fd") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_fd, 2, 1, 1, 1) - self.lineEdit_sparkdesk_api_secret = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_api_secret.setObjectName("lineEdit_sparkdesk_api_secret") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_api_secret, 5, 1, 1, 1) - self.label_sparkdesk_fd = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_fd.setObjectName("label_sparkdesk_fd") - self.gridLayout_54.addWidget(self.label_sparkdesk_fd, 2, 0, 1, 1) - self.label_sparkdesk_GtToken = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_GtToken.setObjectName("label_sparkdesk_GtToken") - self.gridLayout_54.addWidget(self.label_sparkdesk_GtToken, 3, 0, 1, 1) - self.lineEdit_sparkdesk_api_key = QtWidgets.QLineEdit(self.groupBox_sparkdesk) - self.lineEdit_sparkdesk_api_key.setObjectName("lineEdit_sparkdesk_api_key") - self.gridLayout_54.addWidget(self.lineEdit_sparkdesk_api_key, 6, 1, 1, 1) - self.label_sparkdesk_version = QtWidgets.QLabel(self.groupBox_sparkdesk) - self.label_sparkdesk_version.setObjectName("label_sparkdesk_version") - self.gridLayout_54.addWidget(self.label_sparkdesk_version, 7, 0, 1, 1) - self.comboBox_sparkdesk_version = QtWidgets.QComboBox(self.groupBox_sparkdesk) - self.comboBox_sparkdesk_version.setObjectName("comboBox_sparkdesk_version") - self.gridLayout_54.addWidget(self.comboBox_sparkdesk_version, 7, 1, 1, 1) - self.gridLayout_55.addLayout(self.gridLayout_54, 0, 0, 1, 1) - spacerItem15 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_55.addItem(spacerItem15, 0, 1, 1, 1) - self.gridLayout_55.setColumnStretch(0, 9) - self.gridLayout_55.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_sparkdesk) - self.groupBox_bard = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_bard.setObjectName("groupBox_bard") - self.gridLayout_74 = QtWidgets.QGridLayout(self.groupBox_bard) - self.gridLayout_74.setObjectName("gridLayout_74") - self.gridLayout_bard = QtWidgets.QGridLayout() - self.gridLayout_bard.setObjectName("gridLayout_bard") - self.gridLayout_74.addLayout(self.gridLayout_bard, 0, 0, 1, 1) - spacerItem16 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_74.addItem(spacerItem16, 0, 1, 1, 1) - self.gridLayout_74.setColumnStretch(0, 9) - self.gridLayout_74.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_bard) - self.groupBox_yiyan = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_yiyan.setObjectName("groupBox_yiyan") - self.gridLayout_76 = QtWidgets.QGridLayout(self.groupBox_yiyan) - self.gridLayout_76.setObjectName("gridLayout_76") - self.gridLayout_yiyan = QtWidgets.QGridLayout() - self.gridLayout_yiyan.setObjectName("gridLayout_yiyan") - self.gridLayout_76.addLayout(self.gridLayout_yiyan, 0, 0, 1, 1) - spacerItem17 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_76.addItem(spacerItem17, 0, 1, 1, 1) - self.gridLayout_76.setColumnStretch(0, 9) - self.gridLayout_76.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_yiyan) - self.groupBox_tongyi = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_tongyi.setObjectName("groupBox_tongyi") - self.gridLayout_88 = QtWidgets.QGridLayout(self.groupBox_tongyi) - self.gridLayout_88.setObjectName("gridLayout_88") - self.gridLayout_tongyi = QtWidgets.QGridLayout() - self.gridLayout_tongyi.setObjectName("gridLayout_tongyi") - self.gridLayout_88.addLayout(self.gridLayout_tongyi, 0, 0, 1, 1) - spacerItem18 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_88.addItem(spacerItem18, 0, 1, 1, 1) - self.gridLayout_88.setColumnStretch(0, 9) - self.gridLayout_88.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_tongyi) - self.groupBox_chatterbot = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_chatterbot.setObjectName("groupBox_chatterbot") - self.gridLayout_12 = QtWidgets.QGridLayout(self.groupBox_chatterbot) - self.gridLayout_12.setObjectName("gridLayout_12") - self.gridLayout_13 = QtWidgets.QGridLayout() - self.gridLayout_13.setObjectName("gridLayout_13") - self.lineEdit_chatterbot_db_path = QtWidgets.QLineEdit(self.groupBox_chatterbot) - self.lineEdit_chatterbot_db_path.setObjectName("lineEdit_chatterbot_db_path") - self.gridLayout_13.addWidget(self.lineEdit_chatterbot_db_path, 1, 1, 1, 1) - self.label_chatterbot_name = QtWidgets.QLabel(self.groupBox_chatterbot) - self.label_chatterbot_name.setObjectName("label_chatterbot_name") - self.gridLayout_13.addWidget(self.label_chatterbot_name, 0, 0, 1, 1) - self.label_chatterbot_db_path = QtWidgets.QLabel(self.groupBox_chatterbot) - self.label_chatterbot_db_path.setObjectName("label_chatterbot_db_path") - self.gridLayout_13.addWidget(self.label_chatterbot_db_path, 1, 0, 1, 1) - self.lineEdit_chatterbot_name = QtWidgets.QLineEdit(self.groupBox_chatterbot) - self.lineEdit_chatterbot_name.setObjectName("lineEdit_chatterbot_name") - self.gridLayout_13.addWidget(self.lineEdit_chatterbot_name, 0, 1, 1, 1) - self.gridLayout_12.addLayout(self.gridLayout_13, 0, 0, 1, 1) - spacerItem19 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_12.addItem(spacerItem19, 0, 1, 1, 1) - self.gridLayout_12.setColumnStretch(0, 9) - self.verticalLayout.addWidget(self.groupBox_chatterbot) - self.groupBox_edge_tts = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_edge_tts.setObjectName("groupBox_edge_tts") - self.gridLayout_14 = QtWidgets.QGridLayout(self.groupBox_edge_tts) - self.gridLayout_14.setObjectName("gridLayout_14") - self.gridLayout_15 = QtWidgets.QGridLayout() - self.gridLayout_15.setObjectName("gridLayout_15") - self.lineEdit_edge_tts_rate = QtWidgets.QLineEdit(self.groupBox_edge_tts) - self.lineEdit_edge_tts_rate.setObjectName("lineEdit_edge_tts_rate") - self.gridLayout_15.addWidget(self.lineEdit_edge_tts_rate, 1, 1, 1, 1) - self.label_edge_tts_rate = QtWidgets.QLabel(self.groupBox_edge_tts) - self.label_edge_tts_rate.setObjectName("label_edge_tts_rate") - self.gridLayout_15.addWidget(self.label_edge_tts_rate, 1, 0, 1, 1) - self.label_edge_tts_voice = QtWidgets.QLabel(self.groupBox_edge_tts) - self.label_edge_tts_voice.setObjectName("label_edge_tts_voice") - self.gridLayout_15.addWidget(self.label_edge_tts_voice, 0, 0, 1, 1) - self.label_edge_tts_volume = QtWidgets.QLabel(self.groupBox_edge_tts) - self.label_edge_tts_volume.setObjectName("label_edge_tts_volume") - self.gridLayout_15.addWidget(self.label_edge_tts_volume, 2, 0, 1, 1) - self.lineEdit_edge_tts_volume = QtWidgets.QLineEdit(self.groupBox_edge_tts) - self.lineEdit_edge_tts_volume.setObjectName("lineEdit_edge_tts_volume") - self.gridLayout_15.addWidget(self.lineEdit_edge_tts_volume, 2, 1, 1, 1) - self.comboBox_edge_tts_voice = QtWidgets.QComboBox(self.groupBox_edge_tts) - self.comboBox_edge_tts_voice.setMaximumSize(QtCore.QSize(16777215, 100)) - self.comboBox_edge_tts_voice.setObjectName("comboBox_edge_tts_voice") - self.gridLayout_15.addWidget(self.comboBox_edge_tts_voice, 0, 1, 1, 1) - self.gridLayout_14.addLayout(self.gridLayout_15, 0, 1, 1, 1) - spacerItem20 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_14.addItem(spacerItem20, 0, 2, 1, 1) - self.gridLayout_14.setColumnStretch(1, 9) - self.gridLayout_14.setColumnStretch(2, 1) - self.verticalLayout.addWidget(self.groupBox_edge_tts) - self.groupBox_vits = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_vits.setObjectName("groupBox_vits") - self.gridLayout_63 = QtWidgets.QGridLayout(self.groupBox_vits) - self.gridLayout_63.setObjectName("gridLayout_63") - self.gridLayout_vits = QtWidgets.QGridLayout() - self.gridLayout_vits.setObjectName("gridLayout_vits") - self.gridLayout_63.addLayout(self.gridLayout_vits, 0, 0, 1, 1) - spacerItem21 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_63.addItem(spacerItem21, 0, 1, 1, 1) - self.gridLayout_63.setColumnStretch(0, 9) - self.gridLayout_63.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_vits) - self.groupBox_vits_fast = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_vits_fast.setObjectName("groupBox_vits_fast") - self.gridLayout_23 = QtWidgets.QGridLayout(self.groupBox_vits_fast) - self.gridLayout_23.setObjectName("gridLayout_23") - self.gridLayout_24 = QtWidgets.QGridLayout() - self.gridLayout_24.setObjectName("gridLayout_24") - self.label_vits_fast_config_path = QtWidgets.QLabel(self.groupBox_vits_fast) - self.label_vits_fast_config_path.setObjectName("label_vits_fast_config_path") - self.gridLayout_24.addWidget(self.label_vits_fast_config_path, 0, 0, 1, 1) - self.label_vits_fast_speed = QtWidgets.QLabel(self.groupBox_vits_fast) - self.label_vits_fast_speed.setObjectName("label_vits_fast_speed") - self.gridLayout_24.addWidget(self.label_vits_fast_speed, 4, 0, 1, 1) - self.lineEdit_vits_fast_api_ip_port = QtWidgets.QLineEdit(self.groupBox_vits_fast) - self.lineEdit_vits_fast_api_ip_port.setObjectName("lineEdit_vits_fast_api_ip_port") - self.gridLayout_24.addWidget(self.lineEdit_vits_fast_api_ip_port, 1, 2, 1, 1) - self.label_vits_fast_character = QtWidgets.QLabel(self.groupBox_vits_fast) - self.label_vits_fast_character.setObjectName("label_vits_fast_character") - self.gridLayout_24.addWidget(self.label_vits_fast_character, 2, 0, 1, 1) - self.lineEdit_vits_fast_config_path = QtWidgets.QLineEdit(self.groupBox_vits_fast) - self.lineEdit_vits_fast_config_path.setObjectName("lineEdit_vits_fast_config_path") - self.gridLayout_24.addWidget(self.lineEdit_vits_fast_config_path, 0, 2, 1, 1) - self.lineEdit_vits_fast_speed = QtWidgets.QLineEdit(self.groupBox_vits_fast) - self.lineEdit_vits_fast_speed.setObjectName("lineEdit_vits_fast_speed") - self.gridLayout_24.addWidget(self.lineEdit_vits_fast_speed, 4, 2, 1, 1) - self.label_vits_fast_api_ip_port = QtWidgets.QLabel(self.groupBox_vits_fast) - self.label_vits_fast_api_ip_port.setObjectName("label_vits_fast_api_ip_port") - self.gridLayout_24.addWidget(self.label_vits_fast_api_ip_port, 1, 0, 1, 1) - self.label_vits_fast_language = QtWidgets.QLabel(self.groupBox_vits_fast) - self.label_vits_fast_language.setObjectName("label_vits_fast_language") - self.gridLayout_24.addWidget(self.label_vits_fast_language, 3, 0, 1, 1) - self.lineEdit_vits_fast_character = QtWidgets.QLineEdit(self.groupBox_vits_fast) - self.lineEdit_vits_fast_character.setObjectName("lineEdit_vits_fast_character") - self.gridLayout_24.addWidget(self.lineEdit_vits_fast_character, 2, 2, 1, 1) - self.comboBox_vits_fast_language = QtWidgets.QComboBox(self.groupBox_vits_fast) - self.comboBox_vits_fast_language.setObjectName("comboBox_vits_fast_language") - self.comboBox_vits_fast_language.addItem("") - self.comboBox_vits_fast_language.addItem("") - self.comboBox_vits_fast_language.addItem("") - self.comboBox_vits_fast_language.addItem("") - self.comboBox_vits_fast_language.addItem("") - self.gridLayout_24.addWidget(self.comboBox_vits_fast_language, 3, 2, 1, 1) - self.gridLayout_23.addLayout(self.gridLayout_24, 0, 1, 1, 1) - spacerItem22 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_23.addItem(spacerItem22, 0, 2, 1, 1) - self.gridLayout_23.setColumnStretch(1, 9) - self.gridLayout_23.setColumnStretch(2, 1) - self.verticalLayout.addWidget(self.groupBox_vits_fast) - self.groupBox_genshinvoice_top = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_genshinvoice_top.setObjectName("groupBox_genshinvoice_top") - self.gridLayout_44 = QtWidgets.QGridLayout(self.groupBox_genshinvoice_top) - self.gridLayout_44.setObjectName("gridLayout_44") - self.gridLayout_43 = QtWidgets.QGridLayout() - self.gridLayout_43.setObjectName("gridLayout_43") - self.label_genshinvoice_top_speaker = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_speaker.setObjectName("label_genshinvoice_top_speaker") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_speaker, 0, 0, 1, 1) - self.label_genshinvoice_top_noisew = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_noisew.setObjectName("label_genshinvoice_top_noisew") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_noisew, 2, 0, 1, 1) - self.label_genshinvoice_top_format = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_format.setObjectName("label_genshinvoice_top_format") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_format, 4, 0, 1, 1) - self.lineEdit_genshinvoice_top_noisew = QtWidgets.QLineEdit(self.groupBox_genshinvoice_top) - self.lineEdit_genshinvoice_top_noisew.setObjectName("lineEdit_genshinvoice_top_noisew") - self.gridLayout_43.addWidget(self.lineEdit_genshinvoice_top_noisew, 2, 1, 1, 1) - self.label_genshinvoice_top_length = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_length.setObjectName("label_genshinvoice_top_length") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_length, 3, 0, 1, 1) - self.lineEdit_genshinvoice_top_length = QtWidgets.QLineEdit(self.groupBox_genshinvoice_top) - self.lineEdit_genshinvoice_top_length.setObjectName("lineEdit_genshinvoice_top_length") - self.gridLayout_43.addWidget(self.lineEdit_genshinvoice_top_length, 3, 1, 1, 1) - self.comboBox_genshinvoice_top_speaker = QtWidgets.QComboBox(self.groupBox_genshinvoice_top) - self.comboBox_genshinvoice_top_speaker.setObjectName("comboBox_genshinvoice_top_speaker") - self.gridLayout_43.addWidget(self.comboBox_genshinvoice_top_speaker, 0, 1, 1, 1) - self.lineEdit_genshinvoice_top_format = QtWidgets.QLineEdit(self.groupBox_genshinvoice_top) - self.lineEdit_genshinvoice_top_format.setObjectName("lineEdit_genshinvoice_top_format") - self.gridLayout_43.addWidget(self.lineEdit_genshinvoice_top_format, 4, 1, 1, 1) - self.lineEdit_genshinvoice_top_noise = QtWidgets.QLineEdit(self.groupBox_genshinvoice_top) - self.lineEdit_genshinvoice_top_noise.setObjectName("lineEdit_genshinvoice_top_noise") - self.gridLayout_43.addWidget(self.lineEdit_genshinvoice_top_noise, 1, 1, 1, 1) - self.label_genshinvoice_top_noise = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_noise.setObjectName("label_genshinvoice_top_noise") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_noise, 1, 0, 1, 1) - self.label_genshinvoice_top_language = QtWidgets.QLabel(self.groupBox_genshinvoice_top) - self.label_genshinvoice_top_language.setObjectName("label_genshinvoice_top_language") - self.gridLayout_43.addWidget(self.label_genshinvoice_top_language, 5, 0, 1, 1) - self.comboBox_genshinvoice_top_language = QtWidgets.QComboBox(self.groupBox_genshinvoice_top) - self.comboBox_genshinvoice_top_language.setObjectName("comboBox_genshinvoice_top_language") - self.gridLayout_43.addWidget(self.comboBox_genshinvoice_top_language, 5, 1, 1, 1) - self.gridLayout_44.addLayout(self.gridLayout_43, 0, 0, 1, 1) - spacerItem23 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_44.addItem(spacerItem23, 0, 1, 1, 1) - self.gridLayout_44.setColumnStretch(0, 9) - self.gridLayout_44.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_genshinvoice_top) - self.groupBox_elevenlabs = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_elevenlabs.setObjectName("groupBox_elevenlabs") - self.gridLayout_16 = QtWidgets.QGridLayout(self.groupBox_elevenlabs) - self.gridLayout_16.setObjectName("gridLayout_16") - self.gridLayout_17 = QtWidgets.QGridLayout() - self.gridLayout_17.setObjectName("gridLayout_17") - self.lineEdit_elevenlabs_api_key = QtWidgets.QLineEdit(self.groupBox_elevenlabs) - self.lineEdit_elevenlabs_api_key.setObjectName("lineEdit_elevenlabs_api_key") - self.gridLayout_17.addWidget(self.lineEdit_elevenlabs_api_key, 0, 1, 1, 1) - self.label_elevenlabs_voice = QtWidgets.QLabel(self.groupBox_elevenlabs) - self.label_elevenlabs_voice.setObjectName("label_elevenlabs_voice") - self.gridLayout_17.addWidget(self.label_elevenlabs_voice, 1, 0, 1, 1) - self.lineEdit_elevenlabs_voice = QtWidgets.QLineEdit(self.groupBox_elevenlabs) - self.lineEdit_elevenlabs_voice.setObjectName("lineEdit_elevenlabs_voice") - self.gridLayout_17.addWidget(self.lineEdit_elevenlabs_voice, 1, 1, 1, 1) - self.label_elevenlabs_api_key = QtWidgets.QLabel(self.groupBox_elevenlabs) - self.label_elevenlabs_api_key.setObjectName("label_elevenlabs_api_key") - self.gridLayout_17.addWidget(self.label_elevenlabs_api_key, 0, 0, 1, 1) - self.label_elevenlabs_model = QtWidgets.QLabel(self.groupBox_elevenlabs) - self.label_elevenlabs_model.setObjectName("label_elevenlabs_model") - self.gridLayout_17.addWidget(self.label_elevenlabs_model, 2, 0, 1, 1) - self.lineEdit_elevenlabs_model = QtWidgets.QLineEdit(self.groupBox_elevenlabs) - self.lineEdit_elevenlabs_model.setObjectName("lineEdit_elevenlabs_model") - self.gridLayout_17.addWidget(self.lineEdit_elevenlabs_model, 2, 1, 1, 1) - self.gridLayout_16.addLayout(self.gridLayout_17, 0, 0, 1, 1) - spacerItem24 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_16.addItem(spacerItem24, 0, 1, 1, 1) - self.gridLayout_16.setColumnStretch(0, 9) - self.gridLayout_16.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_elevenlabs) - self.groupBox_bark_gui = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_bark_gui.setObjectName("groupBox_bark_gui") - self.gridLayout_57 = QtWidgets.QGridLayout(self.groupBox_bark_gui) - self.gridLayout_57.setObjectName("gridLayout_57") - self.gridLayout_56 = QtWidgets.QGridLayout() - self.gridLayout_56.setObjectName("gridLayout_56") - self.label_bark_gui_api_ip_port = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_api_ip_port.setObjectName("label_bark_gui_api_ip_port") - self.gridLayout_56.addWidget(self.label_bark_gui_api_ip_port, 0, 0, 1, 1) - self.label_bark_gui_quick_generation = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_quick_generation.setObjectName("label_bark_gui_quick_generation") - self.gridLayout_56.addWidget(self.label_bark_gui_quick_generation, 5, 0, 1, 1) - self.label_bark_gui_batch_count = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_batch_count.setObjectName("label_bark_gui_batch_count") - self.gridLayout_56.addWidget(self.label_bark_gui_batch_count, 7, 0, 1, 1) - self.label_bark_gui_end_of_sentence_probability = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_end_of_sentence_probability.setObjectName("label_bark_gui_end_of_sentence_probability") - self.gridLayout_56.addWidget(self.label_bark_gui_end_of_sentence_probability, 4, 0, 1, 1) - self.label_bark_gui_seed = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_seed.setObjectName("label_bark_gui_seed") - self.gridLayout_56.addWidget(self.label_bark_gui_seed, 6, 0, 1, 1) - self.label_bark_gui_generation_temperature = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_generation_temperature.setObjectName("label_bark_gui_generation_temperature") - self.gridLayout_56.addWidget(self.label_bark_gui_generation_temperature, 2, 0, 1, 1) - self.label_bark_gui_waveform_temperature = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_waveform_temperature.setObjectName("label_bark_gui_waveform_temperature") - self.gridLayout_56.addWidget(self.label_bark_gui_waveform_temperature, 3, 0, 1, 1) - self.label_bark_gui_spk = QtWidgets.QLabel(self.groupBox_bark_gui) - self.label_bark_gui_spk.setObjectName("label_bark_gui_spk") - self.gridLayout_56.addWidget(self.label_bark_gui_spk, 1, 0, 1, 1) - self.lineEdit_bark_gui_api_ip_port = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_api_ip_port.setObjectName("lineEdit_bark_gui_api_ip_port") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_api_ip_port, 0, 1, 1, 1) - self.lineEdit_bark_gui_spk = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_spk.setObjectName("lineEdit_bark_gui_spk") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_spk, 1, 1, 1, 1) - self.lineEdit_bark_gui_generation_temperature = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_generation_temperature.setObjectName("lineEdit_bark_gui_generation_temperature") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_generation_temperature, 2, 1, 1, 1) - self.lineEdit_bark_gui_waveform_temperature = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_waveform_temperature.setObjectName("lineEdit_bark_gui_waveform_temperature") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_waveform_temperature, 3, 1, 1, 1) - self.lineEdit_bark_gui_end_of_sentence_probability = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_end_of_sentence_probability.setObjectName("lineEdit_bark_gui_end_of_sentence_probability") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_end_of_sentence_probability, 4, 1, 1, 1) - self.lineEdit_bark_gui_batch_count = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_batch_count.setObjectName("lineEdit_bark_gui_batch_count") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_batch_count, 7, 1, 1, 1) - self.lineEdit_bark_gui_seed = QtWidgets.QLineEdit(self.groupBox_bark_gui) - self.lineEdit_bark_gui_seed.setObjectName("lineEdit_bark_gui_seed") - self.gridLayout_56.addWidget(self.lineEdit_bark_gui_seed, 6, 1, 1, 1) - self.checkBox_bark_gui_quick_generation = QtWidgets.QCheckBox(self.groupBox_bark_gui) - self.checkBox_bark_gui_quick_generation.setObjectName("checkBox_bark_gui_quick_generation") - self.gridLayout_56.addWidget(self.checkBox_bark_gui_quick_generation, 5, 1, 1, 1) - self.gridLayout_57.addLayout(self.gridLayout_56, 0, 0, 1, 1) - spacerItem25 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_57.addItem(spacerItem25, 0, 1, 1, 1) - self.gridLayout_57.setColumnStretch(0, 9) - self.gridLayout_57.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_bark_gui) - self.groupBox_vall_e_x = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_vall_e_x.setObjectName("groupBox_vall_e_x") - self.gridLayout_70 = QtWidgets.QGridLayout(self.groupBox_vall_e_x) - self.gridLayout_70.setObjectName("gridLayout_70") - self.gridLayout_vall_e_x = QtWidgets.QGridLayout() - self.gridLayout_vall_e_x.setObjectName("gridLayout_vall_e_x") - self.gridLayout_70.addLayout(self.gridLayout_vall_e_x, 0, 0, 1, 1) - spacerItem26 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_70.addItem(spacerItem26, 0, 1, 1, 1) - self.gridLayout_70.setColumnStretch(0, 9) - self.gridLayout_70.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_vall_e_x) - self.groupBox_openai_tts = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_openai_tts.setObjectName("groupBox_openai_tts") - self.gridLayout_95 = QtWidgets.QGridLayout(self.groupBox_openai_tts) - self.gridLayout_95.setObjectName("gridLayout_95") - self.gridLayout_openai_tts = QtWidgets.QGridLayout() - self.gridLayout_openai_tts.setObjectName("gridLayout_openai_tts") - self.gridLayout_95.addLayout(self.gridLayout_openai_tts, 0, 0, 1, 1) - spacerItem27 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_95.addItem(spacerItem27, 0, 1, 1, 1) - self.gridLayout_95.setColumnStretch(0, 9) - self.gridLayout_95.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_openai_tts) - self.groupBox_live2d = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_live2d.setObjectName("groupBox_live2d") - self.gridLayout_30 = QtWidgets.QGridLayout(self.groupBox_live2d) - self.gridLayout_30.setObjectName("gridLayout_30") - self.gridLayout_29 = QtWidgets.QGridLayout() - self.gridLayout_29.setObjectName("gridLayout_29") - self.checkBox_live2d_enable = QtWidgets.QCheckBox(self.groupBox_live2d) - self.checkBox_live2d_enable.setObjectName("checkBox_live2d_enable") - self.gridLayout_29.addWidget(self.checkBox_live2d_enable, 0, 1, 1, 1) - self.lineEdit_live2d_port = QtWidgets.QLineEdit(self.groupBox_live2d) - self.lineEdit_live2d_port.setObjectName("lineEdit_live2d_port") - self.gridLayout_29.addWidget(self.lineEdit_live2d_port, 1, 1, 1, 1) - self.label_live2d_port = QtWidgets.QLabel(self.groupBox_live2d) - self.label_live2d_port.setObjectName("label_live2d_port") - self.gridLayout_29.addWidget(self.label_live2d_port, 1, 0, 1, 1) - self.label_live2d_enable = QtWidgets.QLabel(self.groupBox_live2d) - self.label_live2d_enable.setObjectName("label_live2d_enable") - self.gridLayout_29.addWidget(self.label_live2d_enable, 0, 0, 1, 1) - self.label_live2d_name = QtWidgets.QLabel(self.groupBox_live2d) - self.label_live2d_name.setObjectName("label_live2d_name") - self.gridLayout_29.addWidget(self.label_live2d_name, 2, 0, 1, 1) - self.comboBox_live2d_name = QtWidgets.QComboBox(self.groupBox_live2d) - self.comboBox_live2d_name.setObjectName("comboBox_live2d_name") - self.gridLayout_29.addWidget(self.comboBox_live2d_name, 2, 1, 1, 1) - self.gridLayout_29.setColumnStretch(0, 1) - self.gridLayout_29.setColumnStretch(1, 8) - self.gridLayout_30.addLayout(self.gridLayout_29, 0, 0, 1, 1) - spacerItem28 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_30.addItem(spacerItem28, 0, 1, 1, 1) - self.gridLayout_30.setColumnStretch(0, 9) - self.gridLayout_30.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_live2d) - self.groupBox_choose_song = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_choose_song.setObjectName("groupBox_choose_song") - self.gridLayout_34 = QtWidgets.QGridLayout(self.groupBox_choose_song) - self.gridLayout_34.setObjectName("gridLayout_34") - self.gridLayout_33 = QtWidgets.QGridLayout() - self.gridLayout_33.setObjectName("gridLayout_33") - self.label_choose_song_stop_cmd = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_stop_cmd.setObjectName("label_choose_song_stop_cmd") - self.gridLayout_33.addWidget(self.label_choose_song_stop_cmd, 2, 0, 1, 1) - self.lineEdit_choose_song_start_cmd = QtWidgets.QLineEdit(self.groupBox_choose_song) - self.lineEdit_choose_song_start_cmd.setObjectName("lineEdit_choose_song_start_cmd") - self.gridLayout_33.addWidget(self.lineEdit_choose_song_start_cmd, 1, 1, 1, 1) - self.label_choose_song_song_path = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_song_path.setObjectName("label_choose_song_song_path") - self.gridLayout_33.addWidget(self.label_choose_song_song_path, 4, 0, 1, 1) - self.checkBox_choose_song_enable = QtWidgets.QCheckBox(self.groupBox_choose_song) - self.checkBox_choose_song_enable.setObjectName("checkBox_choose_song_enable") - self.gridLayout_33.addWidget(self.checkBox_choose_song_enable, 0, 1, 1, 1) - self.lineEdit_choose_song_song_path = QtWidgets.QLineEdit(self.groupBox_choose_song) - self.lineEdit_choose_song_song_path.setObjectName("lineEdit_choose_song_song_path") - self.gridLayout_33.addWidget(self.lineEdit_choose_song_song_path, 4, 1, 1, 1) - self.label_choose_song_start_cmd = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_start_cmd.setObjectName("label_choose_song_start_cmd") - self.gridLayout_33.addWidget(self.label_choose_song_start_cmd, 1, 0, 1, 1) - self.label_choose_song_enable = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_enable.setObjectName("label_choose_song_enable") - self.gridLayout_33.addWidget(self.label_choose_song_enable, 0, 0, 1, 1) - self.label_choose_song_match_fail_copy = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_match_fail_copy.setObjectName("label_choose_song_match_fail_copy") - self.gridLayout_33.addWidget(self.label_choose_song_match_fail_copy, 5, 0, 1, 1) - self.lineEdit_choose_song_stop_cmd = QtWidgets.QLineEdit(self.groupBox_choose_song) - self.lineEdit_choose_song_stop_cmd.setObjectName("lineEdit_choose_song_stop_cmd") - self.gridLayout_33.addWidget(self.lineEdit_choose_song_stop_cmd, 2, 1, 1, 1) - self.lineEdit_choose_song_match_fail_copy = QtWidgets.QLineEdit(self.groupBox_choose_song) - self.lineEdit_choose_song_match_fail_copy.setObjectName("lineEdit_choose_song_match_fail_copy") - self.gridLayout_33.addWidget(self.lineEdit_choose_song_match_fail_copy, 5, 1, 1, 1) - self.lineEdit_choose_song_random_cmd = QtWidgets.QLineEdit(self.groupBox_choose_song) - self.lineEdit_choose_song_random_cmd.setObjectName("lineEdit_choose_song_random_cmd") - self.gridLayout_33.addWidget(self.lineEdit_choose_song_random_cmd, 3, 1, 1, 1) - self.label_choose_song_random_cmd = QtWidgets.QLabel(self.groupBox_choose_song) - self.label_choose_song_random_cmd.setObjectName("label_choose_song_random_cmd") - self.gridLayout_33.addWidget(self.label_choose_song_random_cmd, 3, 0, 1, 1) - self.gridLayout_34.addLayout(self.gridLayout_33, 0, 0, 1, 1) - spacerItem29 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_34.addItem(spacerItem29, 0, 1, 1, 1) - self.gridLayout_34.setColumnStretch(0, 9) - self.gridLayout_34.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_choose_song) - self.groupBox_schedule = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_schedule.setObjectName("groupBox_schedule") - self.gridLayout_61 = QtWidgets.QGridLayout(self.groupBox_schedule) - self.gridLayout_61.setObjectName("gridLayout_61") - self.gridLayout_schedule = QtWidgets.QGridLayout() - self.gridLayout_schedule.setObjectName("gridLayout_schedule") - self.gridLayout_61.addLayout(self.gridLayout_schedule, 0, 0, 1, 1) - spacerItem30 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_61.addItem(spacerItem30, 0, 1, 1, 1) - self.gridLayout_61.setColumnStretch(0, 9) - self.gridLayout_61.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_schedule) - self.groupBox_idle_time_task = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_idle_time_task.setObjectName("groupBox_idle_time_task") - self.gridLayout_87 = QtWidgets.QGridLayout(self.groupBox_idle_time_task) - self.gridLayout_87.setObjectName("gridLayout_87") - spacerItem31 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_87.addItem(spacerItem31, 0, 1, 1, 1) - self.gridLayout_idle_time_task = QtWidgets.QGridLayout() - self.gridLayout_idle_time_task.setObjectName("gridLayout_idle_time_task") - self.gridLayout_87.addLayout(self.gridLayout_idle_time_task, 0, 0, 1, 1) - self.groupBox_idle_time_task_comment = QtWidgets.QGroupBox(self.groupBox_idle_time_task) - self.groupBox_idle_time_task_comment.setObjectName("groupBox_idle_time_task_comment") - self.gridLayout_94 = QtWidgets.QGridLayout(self.groupBox_idle_time_task_comment) - self.gridLayout_94.setObjectName("gridLayout_94") - self.gridLayout_idle_time_task_comment = QtWidgets.QGridLayout() - self.gridLayout_idle_time_task_comment.setObjectName("gridLayout_idle_time_task_comment") - self.gridLayout_94.addLayout(self.gridLayout_idle_time_task_comment, 0, 0, 1, 1) - self.gridLayout_87.addWidget(self.groupBox_idle_time_task_comment, 1, 0, 1, 1) - self.groupBox_idle_time_task_local_audio = QtWidgets.QGroupBox(self.groupBox_idle_time_task) - self.groupBox_idle_time_task_local_audio.setObjectName("groupBox_idle_time_task_local_audio") - self.gridLayout_96 = QtWidgets.QGridLayout(self.groupBox_idle_time_task_local_audio) - self.gridLayout_96.setObjectName("gridLayout_96") - self.gridLayout_idle_time_task_local_audio = QtWidgets.QGridLayout() - self.gridLayout_idle_time_task_local_audio.setObjectName("gridLayout_idle_time_task_local_audio") - self.gridLayout_96.addLayout(self.gridLayout_idle_time_task_local_audio, 0, 0, 1, 1) - self.gridLayout_87.addWidget(self.groupBox_idle_time_task_local_audio, 2, 0, 1, 1) - self.gridLayout_87.setColumnStretch(0, 9) - self.gridLayout_87.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_idle_time_task) - self.groupBox_ddsp_svc = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_ddsp_svc.setObjectName("groupBox_ddsp_svc") - self.gridLayout_49 = QtWidgets.QGridLayout(self.groupBox_ddsp_svc) - self.gridLayout_49.setObjectName("gridLayout_49") - self.gridLayout_48 = QtWidgets.QGridLayout() - self.gridLayout_48.setObjectName("gridLayout_48") - self.label_ddsp_svc_enable = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_enable.setObjectName("label_ddsp_svc_enable") - self.gridLayout_48.addWidget(self.label_ddsp_svc_enable, 0, 0, 1, 1) - self.label_ddsp_svc_fSafePrefixPadLength = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_fSafePrefixPadLength.setObjectName("label_ddsp_svc_fSafePrefixPadLength") - self.gridLayout_48.addWidget(self.label_ddsp_svc_fSafePrefixPadLength, 3, 0, 1, 1) - self.lineEdit_ddsp_svc_sSpeakId = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_sSpeakId.setObjectName("lineEdit_ddsp_svc_sSpeakId") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_sSpeakId, 5, 1, 1, 1) - self.checkBox_ddsp_svc_enable = QtWidgets.QCheckBox(self.groupBox_ddsp_svc) - self.checkBox_ddsp_svc_enable.setObjectName("checkBox_ddsp_svc_enable") - self.gridLayout_48.addWidget(self.checkBox_ddsp_svc_enable, 0, 1, 1, 1) - self.lineEdit_ddsp_svc_api_ip_port = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_api_ip_port.setObjectName("lineEdit_ddsp_svc_api_ip_port") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_api_ip_port, 2, 1, 1, 1) - self.label_ddsp_svc_api_ip_port = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_api_ip_port.setObjectName("label_ddsp_svc_api_ip_port") - self.gridLayout_48.addWidget(self.label_ddsp_svc_api_ip_port, 2, 0, 1, 1) - self.label_ddsp_svc_config_path = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_config_path.setObjectName("label_ddsp_svc_config_path") - self.gridLayout_48.addWidget(self.label_ddsp_svc_config_path, 1, 0, 1, 1) - self.lineEdit_ddsp_svc_fSafePrefixPadLength = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_fSafePrefixPadLength.setObjectName("lineEdit_ddsp_svc_fSafePrefixPadLength") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_fSafePrefixPadLength, 3, 1, 1, 1) - self.lineEdit_ddsp_svc_fPitchChange = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_fPitchChange.setObjectName("lineEdit_ddsp_svc_fPitchChange") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_fPitchChange, 4, 1, 1, 1) - self.label_ddsp_svc_sSpeakId = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_sSpeakId.setObjectName("label_ddsp_svc_sSpeakId") - self.gridLayout_48.addWidget(self.label_ddsp_svc_sSpeakId, 5, 0, 1, 1) - self.lineEdit_ddsp_svc_config_path = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_config_path.setObjectName("lineEdit_ddsp_svc_config_path") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_config_path, 1, 1, 1, 1) - self.label_ddsp_svc_fPitchChange = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_fPitchChange.setObjectName("label_ddsp_svc_fPitchChange") - self.gridLayout_48.addWidget(self.label_ddsp_svc_fPitchChange, 4, 0, 1, 1) - self.label_ddsp_svc_sampleRate = QtWidgets.QLabel(self.groupBox_ddsp_svc) - self.label_ddsp_svc_sampleRate.setObjectName("label_ddsp_svc_sampleRate") - self.gridLayout_48.addWidget(self.label_ddsp_svc_sampleRate, 6, 0, 1, 1) - self.lineEdit_ddsp_svc_sampleRate = QtWidgets.QLineEdit(self.groupBox_ddsp_svc) - self.lineEdit_ddsp_svc_sampleRate.setObjectName("lineEdit_ddsp_svc_sampleRate") - self.gridLayout_48.addWidget(self.lineEdit_ddsp_svc_sampleRate, 6, 1, 1, 1) - self.gridLayout_49.addLayout(self.gridLayout_48, 0, 0, 1, 1) - spacerItem32 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_49.addItem(spacerItem32, 0, 1, 1, 1) - self.gridLayout_49.setColumnStretch(0, 9) - self.gridLayout_49.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_ddsp_svc) - self.groupBox_so_vits_svc = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_so_vits_svc.setObjectName("groupBox_so_vits_svc") - self.gridLayout_36 = QtWidgets.QGridLayout(self.groupBox_so_vits_svc) - self.gridLayout_36.setObjectName("gridLayout_36") - self.gridLayout_35 = QtWidgets.QGridLayout() - self.gridLayout_35.setObjectName("gridLayout_35") - self.checkBox_so_vits_svc_enable = QtWidgets.QCheckBox(self.groupBox_so_vits_svc) - self.checkBox_so_vits_svc_enable.setObjectName("checkBox_so_vits_svc_enable") - self.gridLayout_35.addWidget(self.checkBox_so_vits_svc_enable, 0, 1, 1, 1) - self.lineEdit_so_vits_svc_api_ip_port = QtWidgets.QLineEdit(self.groupBox_so_vits_svc) - self.lineEdit_so_vits_svc_api_ip_port.setObjectName("lineEdit_so_vits_svc_api_ip_port") - self.gridLayout_35.addWidget(self.lineEdit_so_vits_svc_api_ip_port, 2, 1, 1, 1) - self.label_so_vits_svc_config_path = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_config_path.setObjectName("label_so_vits_svc_config_path") - self.gridLayout_35.addWidget(self.label_so_vits_svc_config_path, 1, 0, 1, 1) - self.label_so_vits_svc_api_ip_port = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_api_ip_port.setObjectName("label_so_vits_svc_api_ip_port") - self.gridLayout_35.addWidget(self.label_so_vits_svc_api_ip_port, 2, 0, 1, 1) - self.lineEdit_so_vits_svc_tran = QtWidgets.QLineEdit(self.groupBox_so_vits_svc) - self.lineEdit_so_vits_svc_tran.setObjectName("lineEdit_so_vits_svc_tran") - self.gridLayout_35.addWidget(self.lineEdit_so_vits_svc_tran, 4, 1, 1, 1) - self.lineEdit_so_vits_svc_config_path = QtWidgets.QLineEdit(self.groupBox_so_vits_svc) - self.lineEdit_so_vits_svc_config_path.setObjectName("lineEdit_so_vits_svc_config_path") - self.gridLayout_35.addWidget(self.lineEdit_so_vits_svc_config_path, 1, 1, 1, 1) - self.label_so_vits_svc_enable = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_enable.setObjectName("label_so_vits_svc_enable") - self.gridLayout_35.addWidget(self.label_so_vits_svc_enable, 0, 0, 1, 1) - self.label_so_vits_svc_spk = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_spk.setObjectName("label_so_vits_svc_spk") - self.gridLayout_35.addWidget(self.label_so_vits_svc_spk, 3, 0, 1, 1) - self.lineEdit_so_vits_svc_spk = QtWidgets.QLineEdit(self.groupBox_so_vits_svc) - self.lineEdit_so_vits_svc_spk.setObjectName("lineEdit_so_vits_svc_spk") - self.gridLayout_35.addWidget(self.lineEdit_so_vits_svc_spk, 3, 1, 1, 1) - self.label_so_vits_svc_tran = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_tran.setObjectName("label_so_vits_svc_tran") - self.gridLayout_35.addWidget(self.label_so_vits_svc_tran, 4, 0, 1, 1) - self.label_so_vits_svc_wav_format = QtWidgets.QLabel(self.groupBox_so_vits_svc) - self.label_so_vits_svc_wav_format.setObjectName("label_so_vits_svc_wav_format") - self.gridLayout_35.addWidget(self.label_so_vits_svc_wav_format, 5, 0, 1, 1) - self.lineEdit_so_vits_svc_wav_format = QtWidgets.QLineEdit(self.groupBox_so_vits_svc) - self.lineEdit_so_vits_svc_wav_format.setObjectName("lineEdit_so_vits_svc_wav_format") - self.gridLayout_35.addWidget(self.lineEdit_so_vits_svc_wav_format, 5, 1, 1, 1) - self.gridLayout_36.addLayout(self.gridLayout_35, 0, 0, 1, 1) - spacerItem33 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_36.addItem(spacerItem33, 0, 1, 1, 1) - self.gridLayout_36.setColumnStretch(0, 9) - self.gridLayout_36.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_so_vits_svc) - self.groupBox_sd = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_sd.setObjectName("groupBox_sd") - self.gridLayout_32 = QtWidgets.QGridLayout(self.groupBox_sd) - self.gridLayout_32.setObjectName("gridLayout_32") - self.gridLayout_31 = QtWidgets.QGridLayout() - self.gridLayout_31.setObjectName("gridLayout_31") - self.lineEdit_sd_hr_second_pass_steps = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_hr_second_pass_steps.setObjectName("lineEdit_sd_hr_second_pass_steps") - self.gridLayout_31.addWidget(self.lineEdit_sd_hr_second_pass_steps, 16, 1, 1, 1) - self.lineEdit_prompt_llm_before_prompt = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_prompt_llm_before_prompt.setObjectName("lineEdit_prompt_llm_before_prompt") - self.gridLayout_31.addWidget(self.lineEdit_prompt_llm_before_prompt, 2, 1, 1, 1) - self.lineEdit_sd_seed = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_seed.setObjectName("lineEdit_sd_seed") - self.gridLayout_31.addWidget(self.lineEdit_sd_seed, 8, 1, 1, 1) - self.lineEdit_sd_steps = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_steps.setObjectName("lineEdit_sd_steps") - self.gridLayout_31.addWidget(self.lineEdit_sd_steps, 11, 1, 1, 1) - self.label_sd_port = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_port.setObjectName("label_sd_port") - self.gridLayout_31.addWidget(self.label_sd_port, 6, 0, 1, 1) - self.lineEdit_sd_cfg_scale = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_cfg_scale.setObjectName("lineEdit_sd_cfg_scale") - self.gridLayout_31.addWidget(self.lineEdit_sd_cfg_scale, 10, 1, 1, 1) - self.label_sd_enable_hr = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_enable_hr.setObjectName("label_sd_enable_hr") - self.gridLayout_31.addWidget(self.label_sd_enable_hr, 14, 0, 1, 1) - self.comboBox_prompt_llm_type = QtWidgets.QComboBox(self.groupBox_sd) - self.comboBox_prompt_llm_type.setObjectName("comboBox_prompt_llm_type") - self.gridLayout_31.addWidget(self.comboBox_prompt_llm_type, 1, 1, 1, 1) - self.lineEdit_sd_hr_resize_x = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_hr_resize_x.setObjectName("lineEdit_sd_hr_resize_x") - self.gridLayout_31.addWidget(self.lineEdit_sd_hr_resize_x, 12, 1, 1, 1) - self.lineEdit_sd_ip = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_ip.setObjectName("lineEdit_sd_ip") - self.gridLayout_31.addWidget(self.lineEdit_sd_ip, 5, 1, 1, 1) - self.label_sd_hr_scale = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_hr_scale.setObjectName("label_sd_hr_scale") - self.gridLayout_31.addWidget(self.label_sd_hr_scale, 15, 0, 1, 1) - self.lineEdit_sd_denoising_strength = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_denoising_strength.setObjectName("lineEdit_sd_denoising_strength") - self.gridLayout_31.addWidget(self.lineEdit_sd_denoising_strength, 17, 1, 1, 1) - self.lineEdit_sd_hr_resize_y = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_hr_resize_y.setObjectName("lineEdit_sd_hr_resize_y") - self.gridLayout_31.addWidget(self.lineEdit_sd_hr_resize_y, 13, 1, 1, 1) - self.lineEdit_sd_port = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_port.setObjectName("lineEdit_sd_port") - self.gridLayout_31.addWidget(self.lineEdit_sd_port, 6, 1, 1, 1) - self.lineEdit_sd_hr_scale = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_hr_scale.setObjectName("lineEdit_sd_hr_scale") - self.gridLayout_31.addWidget(self.lineEdit_sd_hr_scale, 15, 1, 1, 1) - self.label_sd_hr_resize_x = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_hr_resize_x.setObjectName("label_sd_hr_resize_x") - self.gridLayout_31.addWidget(self.label_sd_hr_resize_x, 12, 0, 1, 1) - self.label_sd_hr_second_pass_steps = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_hr_second_pass_steps.setObjectName("label_sd_hr_second_pass_steps") - self.gridLayout_31.addWidget(self.label_sd_hr_second_pass_steps, 16, 0, 1, 1) - self.label_sd_denoising_strength = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_denoising_strength.setObjectName("label_sd_denoising_strength") - self.gridLayout_31.addWidget(self.label_sd_denoising_strength, 17, 0, 1, 1) - self.label_prompt_llm_type = QtWidgets.QLabel(self.groupBox_sd) - self.label_prompt_llm_type.setObjectName("label_prompt_llm_type") - self.gridLayout_31.addWidget(self.label_prompt_llm_type, 1, 0, 1, 1) - self.label_prompt_llm_before_prompt = QtWidgets.QLabel(self.groupBox_sd) - self.label_prompt_llm_before_prompt.setObjectName("label_prompt_llm_before_prompt") - self.gridLayout_31.addWidget(self.label_prompt_llm_before_prompt, 2, 0, 1, 1) - self.checkBox_sd_enable_hr = QtWidgets.QCheckBox(self.groupBox_sd) - self.checkBox_sd_enable_hr.setObjectName("checkBox_sd_enable_hr") - self.gridLayout_31.addWidget(self.checkBox_sd_enable_hr, 14, 1, 1, 1) - self.label_sd_trigger = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_trigger.setObjectName("label_sd_trigger") - self.gridLayout_31.addWidget(self.label_sd_trigger, 4, 0, 1, 1) - self.label_sd_ip = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_ip.setObjectName("label_sd_ip") - self.gridLayout_31.addWidget(self.label_sd_ip, 5, 0, 1, 1) - self.label_sd_steps = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_steps.setObjectName("label_sd_steps") - self.gridLayout_31.addWidget(self.label_sd_steps, 11, 0, 1, 1) - self.label_sd_seed = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_seed.setObjectName("label_sd_seed") - self.gridLayout_31.addWidget(self.label_sd_seed, 8, 0, 1, 1) - self.lineEdit_sd_negative_prompt = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_negative_prompt.setObjectName("lineEdit_sd_negative_prompt") - self.gridLayout_31.addWidget(self.lineEdit_sd_negative_prompt, 7, 1, 1, 1) - self.label_sd_styles = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_styles.setObjectName("label_sd_styles") - self.gridLayout_31.addWidget(self.label_sd_styles, 9, 0, 1, 1) - self.label_sd_enable = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_enable.setObjectName("label_sd_enable") - self.gridLayout_31.addWidget(self.label_sd_enable, 0, 0, 1, 1) - self.label_sd_cfg_scale = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_cfg_scale.setObjectName("label_sd_cfg_scale") - self.gridLayout_31.addWidget(self.label_sd_cfg_scale, 10, 0, 1, 1) - self.textEdit_sd_styles = QtWidgets.QTextEdit(self.groupBox_sd) - self.textEdit_sd_styles.setObjectName("textEdit_sd_styles") - self.gridLayout_31.addWidget(self.textEdit_sd_styles, 9, 1, 1, 1) - self.label_sd_hr_resize_y = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_hr_resize_y.setObjectName("label_sd_hr_resize_y") - self.gridLayout_31.addWidget(self.label_sd_hr_resize_y, 13, 0, 1, 1) - self.lineEdit_sd_trigger = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_sd_trigger.setObjectName("lineEdit_sd_trigger") - self.gridLayout_31.addWidget(self.lineEdit_sd_trigger, 4, 1, 1, 1) - self.checkBox_sd_enable = QtWidgets.QCheckBox(self.groupBox_sd) - self.checkBox_sd_enable.setObjectName("checkBox_sd_enable") - self.gridLayout_31.addWidget(self.checkBox_sd_enable, 0, 1, 1, 1) - self.label_sd_negative_prompt = QtWidgets.QLabel(self.groupBox_sd) - self.label_sd_negative_prompt.setObjectName("label_sd_negative_prompt") - self.gridLayout_31.addWidget(self.label_sd_negative_prompt, 7, 0, 1, 1) - self.label_prompt_llm_after_prompt = QtWidgets.QLabel(self.groupBox_sd) - self.label_prompt_llm_after_prompt.setObjectName("label_prompt_llm_after_prompt") - self.gridLayout_31.addWidget(self.label_prompt_llm_after_prompt, 3, 0, 1, 1) - self.lineEdit_prompt_llm_after_prompt = QtWidgets.QLineEdit(self.groupBox_sd) - self.lineEdit_prompt_llm_after_prompt.setObjectName("lineEdit_prompt_llm_after_prompt") - self.gridLayout_31.addWidget(self.lineEdit_prompt_llm_after_prompt, 3, 1, 1, 1) - self.gridLayout_32.addLayout(self.gridLayout_31, 0, 0, 1, 1) - spacerItem34 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_32.addItem(spacerItem34, 0, 1, 1, 1) - self.gridLayout_32.setColumnStretch(0, 9) - self.gridLayout_32.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_sd) - self.groupBox_trends_copywriting = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_trends_copywriting.setObjectName("groupBox_trends_copywriting") - self.gridLayout_66 = QtWidgets.QGridLayout(self.groupBox_trends_copywriting) - self.gridLayout_66.setObjectName("gridLayout_66") - self.gridLayout_trends_copywriting = QtWidgets.QGridLayout() - self.gridLayout_trends_copywriting.setObjectName("gridLayout_trends_copywriting") - self.label_trends_copywriting_random_play = QtWidgets.QLabel(self.groupBox_trends_copywriting) - self.label_trends_copywriting_random_play.setObjectName("label_trends_copywriting_random_play") - self.gridLayout_trends_copywriting.addWidget(self.label_trends_copywriting_random_play, 2, 0, 1, 1) - self.checkBox_trends_copywriting_random_play = QtWidgets.QCheckBox(self.groupBox_trends_copywriting) - self.checkBox_trends_copywriting_random_play.setObjectName("checkBox_trends_copywriting_random_play") - self.gridLayout_trends_copywriting.addWidget(self.checkBox_trends_copywriting_random_play, 2, 1, 1, 1) - self.lineEdit_trends_copywriting_play_interval = QtWidgets.QLineEdit(self.groupBox_trends_copywriting) - self.lineEdit_trends_copywriting_play_interval.setObjectName("lineEdit_trends_copywriting_play_interval") - self.gridLayout_trends_copywriting.addWidget(self.lineEdit_trends_copywriting_play_interval, 3, 1, 1, 1) - self.gridLayout_trends_copywriting_2 = QtWidgets.QGridLayout() - self.gridLayout_trends_copywriting_2.setObjectName("gridLayout_trends_copywriting_2") - self.gridLayout_trends_copywriting.addLayout(self.gridLayout_trends_copywriting_2, 0, 0, 1, 2) - self.label_trends_copywriting_play_interval = QtWidgets.QLabel(self.groupBox_trends_copywriting) - self.label_trends_copywriting_play_interval.setObjectName("label_trends_copywriting_play_interval") - self.gridLayout_trends_copywriting.addWidget(self.label_trends_copywriting_play_interval, 3, 0, 1, 1) - self.label_trends_copywriting_enable = QtWidgets.QLabel(self.groupBox_trends_copywriting) - self.label_trends_copywriting_enable.setObjectName("label_trends_copywriting_enable") - self.gridLayout_trends_copywriting.addWidget(self.label_trends_copywriting_enable, 1, 0, 1, 1) - self.checkBox_trends_copywriting_enable = QtWidgets.QCheckBox(self.groupBox_trends_copywriting) - self.checkBox_trends_copywriting_enable.setObjectName("checkBox_trends_copywriting_enable") - self.gridLayout_trends_copywriting.addWidget(self.checkBox_trends_copywriting_enable, 1, 1, 1, 1) - self.gridLayout_66.addLayout(self.gridLayout_trends_copywriting, 0, 0, 1, 1) - spacerItem35 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_66.addItem(spacerItem35, 0, 1, 1, 1) - self.gridLayout_66.setColumnStretch(0, 9) - self.gridLayout_66.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_trends_copywriting) - self.groupBox_header = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_header.setObjectName("groupBox_header") - self.gridLayout_18 = QtWidgets.QGridLayout(self.groupBox_header) - self.gridLayout_18.setObjectName("gridLayout_18") - self.gridLayout_19 = QtWidgets.QGridLayout() - self.gridLayout_19.setObjectName("gridLayout_19") - self.label_header_useragent = QtWidgets.QLabel(self.groupBox_header) - self.label_header_useragent.setObjectName("label_header_useragent") - self.gridLayout_19.addWidget(self.label_header_useragent, 0, 0, 1, 1) - self.lineEdit_header_useragent = QtWidgets.QLineEdit(self.groupBox_header) - self.lineEdit_header_useragent.setObjectName("lineEdit_header_useragent") - self.gridLayout_19.addWidget(self.lineEdit_header_useragent, 0, 1, 1, 1) - self.gridLayout_18.addLayout(self.gridLayout_19, 0, 1, 1, 1) - spacerItem36 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_18.addItem(spacerItem36, 0, 2, 1, 1) - self.gridLayout_18.setColumnStretch(1, 9) - self.gridLayout_18.setColumnStretch(2, 1) - self.verticalLayout.addWidget(self.groupBox_header) - self.groupBox_web_captions_printer = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_web_captions_printer.setObjectName("groupBox_web_captions_printer") - self.gridLayout_69 = QtWidgets.QGridLayout(self.groupBox_web_captions_printer) - self.gridLayout_69.setObjectName("gridLayout_69") - self.gridLayout_web_captions_printer = QtWidgets.QGridLayout() - self.gridLayout_web_captions_printer.setObjectName("gridLayout_web_captions_printer") - self.gridLayout_69.addLayout(self.gridLayout_web_captions_printer, 0, 0, 1, 1) - spacerItem37 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_69.addItem(spacerItem37, 0, 1, 1, 1) - self.gridLayout_69.setColumnStretch(0, 9) - self.gridLayout_69.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_web_captions_printer) - self.groupBox_database = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_database.setObjectName("groupBox_database") - self.gridLayout_67 = QtWidgets.QGridLayout(self.groupBox_database) - self.gridLayout_67.setObjectName("gridLayout_67") - self.gridLayout_database = QtWidgets.QGridLayout() - self.gridLayout_database.setObjectName("gridLayout_database") - self.gridLayout_67.addLayout(self.gridLayout_database, 0, 0, 1, 1) - spacerItem38 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_67.addItem(spacerItem38, 0, 1, 1, 1) - self.gridLayout_67.setColumnStretch(0, 9) - self.gridLayout_67.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_database) - self.groupBox_key_mapping = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_key_mapping.setObjectName("groupBox_key_mapping") - self.gridLayout_90 = QtWidgets.QGridLayout(self.groupBox_key_mapping) - self.gridLayout_90.setObjectName("gridLayout_90") - spacerItem39 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_90.addItem(spacerItem39, 0, 1, 1, 1) - self.gridLayout_key_mapping = QtWidgets.QGridLayout() - self.gridLayout_key_mapping.setObjectName("gridLayout_key_mapping") - self.checkBox_key_mapping_enable = QtWidgets.QCheckBox(self.groupBox_key_mapping) - self.checkBox_key_mapping_enable.setObjectName("checkBox_key_mapping_enable") - self.gridLayout_key_mapping.addWidget(self.checkBox_key_mapping_enable, 0, 1, 1, 1) - self.label_key_mapping_enable = QtWidgets.QLabel(self.groupBox_key_mapping) - self.label_key_mapping_enable.setObjectName("label_key_mapping_enable") - self.gridLayout_key_mapping.addWidget(self.label_key_mapping_enable, 0, 0, 1, 1) - self.lineEdit_key_mapping_start_cmd = QtWidgets.QLineEdit(self.groupBox_key_mapping) - self.lineEdit_key_mapping_start_cmd.setObjectName("lineEdit_key_mapping_start_cmd") - self.gridLayout_key_mapping.addWidget(self.lineEdit_key_mapping_start_cmd, 2, 1, 1, 1) - self.label_key_mapping_start_cmd = QtWidgets.QLabel(self.groupBox_key_mapping) - self.label_key_mapping_start_cmd.setObjectName("label_key_mapping_start_cmd") - self.gridLayout_key_mapping.addWidget(self.label_key_mapping_start_cmd, 2, 0, 1, 1) - self.label_key_mapping_type = QtWidgets.QLabel(self.groupBox_key_mapping) - self.label_key_mapping_type.setObjectName("label_key_mapping_type") - self.gridLayout_key_mapping.addWidget(self.label_key_mapping_type, 1, 0, 1, 1) - self.comboBox_key_mapping_type = QtWidgets.QComboBox(self.groupBox_key_mapping) - self.comboBox_key_mapping_type.setObjectName("comboBox_key_mapping_type") - self.gridLayout_key_mapping.addWidget(self.comboBox_key_mapping_type, 1, 1, 1, 1) - self.gridLayout_90.addLayout(self.gridLayout_key_mapping, 0, 0, 1, 1) - self.gridLayout_key_mapping_config = QtWidgets.QGridLayout() - self.gridLayout_key_mapping_config.setObjectName("gridLayout_key_mapping_config") - self.gridLayout_90.addLayout(self.gridLayout_key_mapping_config, 1, 0, 1, 1) - self.gridLayout_90.setColumnStretch(0, 9) - self.gridLayout_90.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_key_mapping) - self.groupBox_unity = QtWidgets.QGroupBox(self.scrollAreaWidgetContents) - self.groupBox_unity.setObjectName("groupBox_unity") - self.gridLayout_97 = QtWidgets.QGridLayout(self.groupBox_unity) - self.gridLayout_97.setObjectName("gridLayout_97") - self.gridLayout_unity = QtWidgets.QGridLayout() - self.gridLayout_unity.setObjectName("gridLayout_unity") - self.gridLayout_97.addLayout(self.gridLayout_unity, 0, 0, 1, 1) - spacerItem40 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_97.addItem(spacerItem40, 0, 1, 1, 1) - self.gridLayout_97.setColumnStretch(0, 9) - self.gridLayout_97.setColumnStretch(1, 1) - self.verticalLayout.addWidget(self.groupBox_unity) - self.scrollArea.setWidget(self.scrollAreaWidgetContents) - self.gridLayout_21.addWidget(self.scrollArea, 0, 0, 1, 1) - self.stackedWidget.addWidget(self.page) - self.page_2 = QtWidgets.QWidget() - self.page_2.setObjectName("page_2") - self.gridLayout_22 = QtWidgets.QGridLayout(self.page_2) - self.gridLayout_22.setObjectName("gridLayout_22") - self.textBrowser = QtWidgets.QTextBrowser(self.page_2) - self.textBrowser.setStyleSheet("font: 12pt \"仿宋\";\n" -"") - self.textBrowser.setObjectName("textBrowser") - self.gridLayout_22.addWidget(self.textBrowser, 0, 0, 1, 1) - self.stackedWidget.addWidget(self.page_2) - self.page_3 = QtWidgets.QWidget() - self.page_3.setObjectName("page_3") - self.gridLayout_38 = QtWidgets.QGridLayout(self.page_3) - self.gridLayout_38.setObjectName("gridLayout_38") - self.scrollArea_2 = QtWidgets.QScrollArea(self.page_3) - self.scrollArea_2.setStyleSheet("font: 75 13pt \"微软雅黑\";\n" -"") - self.scrollArea_2.setWidgetResizable(True) - self.scrollArea_2.setObjectName("scrollArea_2") - self.scrollAreaWidgetContents_2 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 698, 1156)) - self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2") - self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_2) - self.verticalLayout_2.setObjectName("verticalLayout_2") - self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents_2) - self.widget.setAutoFillBackground(False) - self.widget.setStyleSheet("") - self.widget.setObjectName("widget") - self.gridLayout_37 = QtWidgets.QGridLayout(self.widget) - self.gridLayout_37.setObjectName("gridLayout_37") - self.label_copywriting_edit = QtWidgets.QLabel(self.widget) - self.label_copywriting_edit.setStyleSheet("") - self.label_copywriting_edit.setObjectName("label_copywriting_edit") - self.gridLayout_37.addWidget(self.label_copywriting_edit, 6, 0, 1, 1) - self.pushButton_copywriting_save = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_save.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_save.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_save.setObjectName("pushButton_copywriting_save") - self.gridLayout_37.addWidget(self.pushButton_copywriting_save, 7, 2, 1, 1) - self.scrollArea_copywriting_config = QtWidgets.QScrollArea(self.widget) - self.scrollArea_copywriting_config.setMinimumSize(QtCore.QSize(0, 500)) - self.scrollArea_copywriting_config.setMaximumSize(QtCore.QSize(16777215, 16777215)) - self.scrollArea_copywriting_config.setWidgetResizable(True) - self.scrollArea_copywriting_config.setObjectName("scrollArea_copywriting_config") - self.scrollAreaWidgetContents_4 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 359, 104)) - self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4") - self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_4) - self.verticalLayout_4.setObjectName("verticalLayout_4") - self.widget_copywriting_config = QtWidgets.QWidget(self.scrollAreaWidgetContents_4) - self.widget_copywriting_config.setObjectName("widget_copywriting_config") - self.gridLayout_25 = QtWidgets.QGridLayout(self.widget_copywriting_config) - self.gridLayout_25.setObjectName("gridLayout_25") - self.pushButton_copywriting_config_index_add = QtWidgets.QPushButton(self.widget_copywriting_config) - self.pushButton_copywriting_config_index_add.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_config_index_add.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_config_index_add.setObjectName("pushButton_copywriting_config_index_add") - self.gridLayout_25.addWidget(self.pushButton_copywriting_config_index_add, 0, 2, 1, 1) - self.lineEdit_copywriting_config_index = QtWidgets.QLineEdit(self.widget_copywriting_config) - self.lineEdit_copywriting_config_index.setStyleSheet("min-height:40px;") - self.lineEdit_copywriting_config_index.setObjectName("lineEdit_copywriting_config_index") - self.gridLayout_25.addWidget(self.lineEdit_copywriting_config_index, 0, 1, 1, 1) - self.label_copywriting_config_index = QtWidgets.QLabel(self.widget_copywriting_config) - self.label_copywriting_config_index.setObjectName("label_copywriting_config_index") - self.gridLayout_25.addWidget(self.label_copywriting_config_index, 0, 0, 1, 1) - self.pushButton_copywriting_config_index_del = QtWidgets.QPushButton(self.widget_copywriting_config) - self.pushButton_copywriting_config_index_del.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_config_index_del.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_config_index_del.setObjectName("pushButton_copywriting_config_index_del") - self.gridLayout_25.addWidget(self.pushButton_copywriting_config_index_del, 0, 3, 1, 1) - self.gridLayout_copywriting_config = QtWidgets.QGridLayout() - self.gridLayout_copywriting_config.setObjectName("gridLayout_copywriting_config") - self.gridLayout_25.addLayout(self.gridLayout_copywriting_config, 1, 0, 1, 4) - self.gridLayout_25.setColumnStretch(0, 1) - self.gridLayout_25.setColumnStretch(1, 5) - self.gridLayout_25.setColumnStretch(2, 1) - self.gridLayout_25.setColumnStretch(3, 1) - self.verticalLayout_4.addWidget(self.widget_copywriting_config) - self.scrollArea_copywriting_config.setWidget(self.scrollAreaWidgetContents_4) - self.gridLayout_37.addWidget(self.scrollArea_copywriting_config, 0, 0, 1, 6) - self.pushButton_copywriting_pause_play = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_pause_play.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_pause_play.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_pause_play.setObjectName("pushButton_copywriting_pause_play") - self.gridLayout_37.addWidget(self.pushButton_copywriting_pause_play, 7, 5, 1, 1) - self.pushButton_copywriting_synthetic_audio = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_synthetic_audio.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_synthetic_audio.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_synthetic_audio.setObjectName("pushButton_copywriting_synthetic_audio") - self.gridLayout_37.addWidget(self.pushButton_copywriting_synthetic_audio, 7, 3, 1, 1) - self.pushButton_copywriting_loop_play = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_loop_play.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_loop_play.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_loop_play.setObjectName("pushButton_copywriting_loop_play") - self.gridLayout_37.addWidget(self.pushButton_copywriting_loop_play, 7, 4, 1, 1) - self.lineEdit_copywriting_audio_interval = QtWidgets.QLineEdit(self.widget) - self.lineEdit_copywriting_audio_interval.setStyleSheet("min-height:40px;") - self.lineEdit_copywriting_audio_interval.setObjectName("lineEdit_copywriting_audio_interval") - self.gridLayout_37.addWidget(self.lineEdit_copywriting_audio_interval, 1, 1, 1, 5) - self.pushButton_copywriting_refresh_list = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_refresh_list.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_refresh_list.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_refresh_list.setObjectName("pushButton_copywriting_refresh_list") - self.gridLayout_37.addWidget(self.pushButton_copywriting_refresh_list, 5, 5, 1, 1) - self.label_copywriting_select = QtWidgets.QLabel(self.widget) - self.label_copywriting_select.setStyleSheet("") - self.label_copywriting_select.setObjectName("label_copywriting_select") - self.gridLayout_37.addWidget(self.label_copywriting_select, 5, 0, 1, 1) - self.label_copywriting_switching_random_play = QtWidgets.QLabel(self.widget) - self.label_copywriting_switching_random_play.setStyleSheet("") - self.label_copywriting_switching_random_play.setObjectName("label_copywriting_switching_random_play") - self.gridLayout_37.addWidget(self.label_copywriting_switching_random_play, 4, 0, 1, 1) - spacerItem41 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_37.addItem(spacerItem41, 7, 0, 1, 1) - self.label_copywriting_audio_interval = QtWidgets.QLabel(self.widget) - self.label_copywriting_audio_interval.setStyleSheet("") - self.label_copywriting_audio_interval.setObjectName("label_copywriting_audio_interval") - self.gridLayout_37.addWidget(self.label_copywriting_audio_interval, 1, 0, 1, 1) - self.lineEdit_copywriting_switching_interval = QtWidgets.QLineEdit(self.widget) - self.lineEdit_copywriting_switching_interval.setStyleSheet("min-height:40px;") - self.lineEdit_copywriting_switching_interval.setObjectName("lineEdit_copywriting_switching_interval") - self.gridLayout_37.addWidget(self.lineEdit_copywriting_switching_interval, 2, 1, 1, 5) - spacerItem42 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_37.addItem(spacerItem42, 7, 1, 1, 1) - self.pushButton_copywriting_select = QtWidgets.QPushButton(self.widget) - self.pushButton_copywriting_select.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_copywriting_select.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_copywriting_select.setObjectName("pushButton_copywriting_select") - self.gridLayout_37.addWidget(self.pushButton_copywriting_select, 5, 4, 1, 1) - self.textEdit_copywriting_edit = QtWidgets.QTextEdit(self.widget) - self.textEdit_copywriting_edit.setStyleSheet("min-height:300px;") - self.textEdit_copywriting_edit.setObjectName("textEdit_copywriting_edit") - self.gridLayout_37.addWidget(self.textEdit_copywriting_edit, 6, 1, 1, 5) - self.lineEdit_copywriting_select = QtWidgets.QLineEdit(self.widget) - self.lineEdit_copywriting_select.setStyleSheet("min-height:50px;") - self.lineEdit_copywriting_select.setObjectName("lineEdit_copywriting_select") - self.gridLayout_37.addWidget(self.lineEdit_copywriting_select, 5, 1, 1, 3) - self.checkBox_copywriting_switching_random_play = QtWidgets.QCheckBox(self.widget) - self.checkBox_copywriting_switching_random_play.setStyleSheet("min-height:40px;") - self.checkBox_copywriting_switching_random_play.setObjectName("checkBox_copywriting_switching_random_play") - self.gridLayout_37.addWidget(self.checkBox_copywriting_switching_random_play, 4, 1, 1, 1) - self.label_copywriting_switching_interval = QtWidgets.QLabel(self.widget) - self.label_copywriting_switching_interval.setStyleSheet("") - self.label_copywriting_switching_interval.setObjectName("label_copywriting_switching_interval") - self.gridLayout_37.addWidget(self.label_copywriting_switching_interval, 2, 0, 1, 1) - self.label_copywriting_switching_auto_play = QtWidgets.QLabel(self.widget) - self.label_copywriting_switching_auto_play.setObjectName("label_copywriting_switching_auto_play") - self.gridLayout_37.addWidget(self.label_copywriting_switching_auto_play, 3, 0, 1, 1) - self.checkBox_copywriting_switching_auto_play = QtWidgets.QCheckBox(self.widget) - self.checkBox_copywriting_switching_auto_play.setObjectName("checkBox_copywriting_switching_auto_play") - self.gridLayout_37.addWidget(self.checkBox_copywriting_switching_auto_play, 3, 1, 1, 1) - self.gridLayout_37.setColumnStretch(0, 1) - self.gridLayout_37.setColumnStretch(1, 3) - self.gridLayout_37.setColumnStretch(2, 1) - self.gridLayout_37.setColumnStretch(3, 1) - self.gridLayout_37.setColumnStretch(4, 1) - self.gridLayout_37.setColumnStretch(5, 1) - self.verticalLayout_2.addWidget(self.widget) - self.scrollArea_2.setWidget(self.scrollAreaWidgetContents_2) - self.gridLayout_38.addWidget(self.scrollArea_2, 0, 0, 1, 1) - self.stackedWidget.addWidget(self.page_3) - self.page_4 = QtWidgets.QWidget() - self.page_4.setObjectName("page_4") - self.gridLayout_39 = QtWidgets.QGridLayout(self.page_4) - self.gridLayout_39.setObjectName("gridLayout_39") - self.scrollArea_3 = QtWidgets.QScrollArea(self.page_4) - self.scrollArea_3.setStyleSheet("font: 75 14pt \"微软雅黑\";\n" -"") - self.scrollArea_3.setWidgetResizable(True) - self.scrollArea_3.setObjectName("scrollArea_3") - self.scrollAreaWidgetContents_3 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 433, 911)) - self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3") - self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_3) - self.verticalLayout_3.setObjectName("verticalLayout_3") - self.widget_2 = QtWidgets.QWidget(self.scrollAreaWidgetContents_3) - self.widget_2.setObjectName("widget_2") - self.gridLayout_40 = QtWidgets.QGridLayout(self.widget_2) - self.gridLayout_40.setObjectName("gridLayout_40") - self.checkBox_talk_continuous_talk = QtWidgets.QCheckBox(self.widget_2) - self.checkBox_talk_continuous_talk.setObjectName("checkBox_talk_continuous_talk") - self.gridLayout_40.addWidget(self.checkBox_talk_continuous_talk, 1, 1, 1, 4) - self.lineEdit_talk_silence_threshold = QtWidgets.QLineEdit(self.widget_2) - self.lineEdit_talk_silence_threshold.setObjectName("lineEdit_talk_silence_threshold") - self.gridLayout_40.addWidget(self.lineEdit_talk_silence_threshold, 6, 1, 1, 4) - self.label_talk_continuous_talk = QtWidgets.QLabel(self.widget_2) - self.label_talk_continuous_talk.setObjectName("label_talk_continuous_talk") - self.gridLayout_40.addWidget(self.label_talk_continuous_talk, 1, 0, 1, 1) - self.lineEdit_talk_username = QtWidgets.QLineEdit(self.widget_2) - self.lineEdit_talk_username.setObjectName("lineEdit_talk_username") - self.gridLayout_40.addWidget(self.lineEdit_talk_username, 0, 1, 1, 4) - self.label_talk_username = QtWidgets.QLabel(self.widget_2) - self.label_talk_username.setObjectName("label_talk_username") - self.gridLayout_40.addWidget(self.label_talk_username, 0, 0, 1, 1) - self.textEdit_talk_chat_box = QtWidgets.QTextEdit(self.widget_2) - self.textEdit_talk_chat_box.setObjectName("textEdit_talk_chat_box") - self.gridLayout_40.addWidget(self.textEdit_talk_chat_box, 9, 1, 1, 1) - self.pushButton_talk_chat_box_reread = QtWidgets.QPushButton(self.widget_2) - self.pushButton_talk_chat_box_reread.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_talk_chat_box_reread.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_talk_chat_box_reread.setObjectName("pushButton_talk_chat_box_reread") - self.gridLayout_40.addWidget(self.pushButton_talk_chat_box_reread, 9, 3, 1, 1) - self.groupBox_talk_google = QtWidgets.QGroupBox(self.widget_2) - self.groupBox_talk_google.setObjectName("groupBox_talk_google") - self.gridLayout_41 = QtWidgets.QGridLayout(self.groupBox_talk_google) - self.gridLayout_41.setObjectName("gridLayout_41") - self.comboBox_talk_google_tgt_lang = QtWidgets.QComboBox(self.groupBox_talk_google) - self.comboBox_talk_google_tgt_lang.setObjectName("comboBox_talk_google_tgt_lang") - self.gridLayout_41.addWidget(self.comboBox_talk_google_tgt_lang, 1, 1, 1, 1) - self.label_talk_google_tgt_lang = QtWidgets.QLabel(self.groupBox_talk_google) - self.label_talk_google_tgt_lang.setObjectName("label_talk_google_tgt_lang") - self.gridLayout_41.addWidget(self.label_talk_google_tgt_lang, 1, 0, 1, 1) - self.gridLayout_41.setColumnStretch(0, 1) - self.gridLayout_41.setColumnStretch(1, 8) - self.gridLayout_40.addWidget(self.groupBox_talk_google, 8, 0, 1, 5) - self.pushButton_talk_chat_box_send = QtWidgets.QPushButton(self.widget_2) - self.pushButton_talk_chat_box_send.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_talk_chat_box_send.setStyleSheet("text-align: center;\n" -"padding: 12px 16px;\n" -"font: 80 10pt \"微软雅黑\";\n" -"border:2px solid #ffffff;\n" -"border-radius: 3px;") - self.pushButton_talk_chat_box_send.setObjectName("pushButton_talk_chat_box_send") - self.gridLayout_40.addWidget(self.pushButton_talk_chat_box_send, 9, 2, 1, 1) - self.comboBox_talk_stop_trigger_key = QtWidgets.QComboBox(self.widget_2) - self.comboBox_talk_stop_trigger_key.setObjectName("comboBox_talk_stop_trigger_key") - self.gridLayout_40.addWidget(self.comboBox_talk_stop_trigger_key, 3, 1, 1, 4) - self.label_talk_silence_threshold = QtWidgets.QLabel(self.widget_2) - self.label_talk_silence_threshold.setObjectName("label_talk_silence_threshold") - self.gridLayout_40.addWidget(self.label_talk_silence_threshold, 6, 0, 1, 1) - self.label_talk_stop_trigger_key = QtWidgets.QLabel(self.widget_2) - self.label_talk_stop_trigger_key.setObjectName("label_talk_stop_trigger_key") - self.gridLayout_40.addWidget(self.label_talk_stop_trigger_key, 3, 0, 1, 1) - self.label_talk_trigger_key = QtWidgets.QLabel(self.widget_2) - self.label_talk_trigger_key.setObjectName("label_talk_trigger_key") - self.gridLayout_40.addWidget(self.label_talk_trigger_key, 2, 0, 1, 1) - self.textBrowser_talk_log = QtWidgets.QTextBrowser(self.widget_2) - self.textBrowser_talk_log.setStyleSheet("font: 12pt \"仿宋\";\n" -"min-height:200px;\n" -"") - self.textBrowser_talk_log.setObjectName("textBrowser_talk_log") - self.gridLayout_40.addWidget(self.textBrowser_talk_log, 10, 0, 2, 5) - self.label_talk_volume_threshold = QtWidgets.QLabel(self.widget_2) - self.label_talk_volume_threshold.setObjectName("label_talk_volume_threshold") - self.gridLayout_40.addWidget(self.label_talk_volume_threshold, 5, 0, 1, 1) - self.lineEdit_talk_volume_threshold = QtWidgets.QLineEdit(self.widget_2) - self.lineEdit_talk_volume_threshold.setObjectName("lineEdit_talk_volume_threshold") - self.gridLayout_40.addWidget(self.lineEdit_talk_volume_threshold, 5, 1, 1, 4) - self.label_talk_type = QtWidgets.QLabel(self.widget_2) - self.label_talk_type.setObjectName("label_talk_type") - self.gridLayout_40.addWidget(self.label_talk_type, 4, 0, 1, 1) - self.label_talk_chat_box = QtWidgets.QLabel(self.widget_2) - self.label_talk_chat_box.setObjectName("label_talk_chat_box") - self.gridLayout_40.addWidget(self.label_talk_chat_box, 9, 0, 1, 1) - self.comboBox_talk_trigger_key = QtWidgets.QComboBox(self.widget_2) - self.comboBox_talk_trigger_key.setObjectName("comboBox_talk_trigger_key") - self.gridLayout_40.addWidget(self.comboBox_talk_trigger_key, 2, 1, 1, 4) - self.comboBox_talk_type = QtWidgets.QComboBox(self.widget_2) - self.comboBox_talk_type.setObjectName("comboBox_talk_type") - self.gridLayout_40.addWidget(self.comboBox_talk_type, 4, 1, 1, 4) - self.groupBox_talk_baidu = QtWidgets.QGroupBox(self.widget_2) - self.groupBox_talk_baidu.setObjectName("groupBox_talk_baidu") - self.gridLayout_45 = QtWidgets.QGridLayout(self.groupBox_talk_baidu) - self.gridLayout_45.setObjectName("gridLayout_45") - self.lineEdit_talk_baidu_app_id = QtWidgets.QLineEdit(self.groupBox_talk_baidu) - self.lineEdit_talk_baidu_app_id.setObjectName("lineEdit_talk_baidu_app_id") - self.gridLayout_45.addWidget(self.lineEdit_talk_baidu_app_id, 0, 1, 1, 1) - self.label_talk_baidu_app_id = QtWidgets.QLabel(self.groupBox_talk_baidu) - self.label_talk_baidu_app_id.setObjectName("label_talk_baidu_app_id") - self.gridLayout_45.addWidget(self.label_talk_baidu_app_id, 0, 0, 1, 1) - self.lineEdit_talk_baidu_api_key = QtWidgets.QLineEdit(self.groupBox_talk_baidu) - self.lineEdit_talk_baidu_api_key.setObjectName("lineEdit_talk_baidu_api_key") - self.gridLayout_45.addWidget(self.lineEdit_talk_baidu_api_key, 1, 1, 1, 1) - self.label_talk_baidu_api_key = QtWidgets.QLabel(self.groupBox_talk_baidu) - self.label_talk_baidu_api_key.setObjectName("label_talk_baidu_api_key") - self.gridLayout_45.addWidget(self.label_talk_baidu_api_key, 1, 0, 1, 1) - self.label_talk_baidu_secret_key = QtWidgets.QLabel(self.groupBox_talk_baidu) - self.label_talk_baidu_secret_key.setObjectName("label_talk_baidu_secret_key") - self.gridLayout_45.addWidget(self.label_talk_baidu_secret_key, 2, 0, 1, 1) - self.lineEdit_talk_baidu_secret_key = QtWidgets.QLineEdit(self.groupBox_talk_baidu) - self.lineEdit_talk_baidu_secret_key.setObjectName("lineEdit_talk_baidu_secret_key") - self.gridLayout_45.addWidget(self.lineEdit_talk_baidu_secret_key, 2, 1, 1, 1) - self.gridLayout_40.addWidget(self.groupBox_talk_baidu, 7, 0, 1, 5) - spacerItem43 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_40.addItem(spacerItem43, 0, 5, 1, 1) - self.gridLayout_40.setRowMinimumHeight(0, 1) - self.gridLayout_40.setRowMinimumHeight(1, 1) - self.gridLayout_40.setRowMinimumHeight(2, 1) - self.gridLayout_40.setRowMinimumHeight(3, 1) - self.gridLayout_40.setRowMinimumHeight(4, 1) - self.gridLayout_40.setRowMinimumHeight(5, 1) - self.gridLayout_40.setRowMinimumHeight(6, 1) - self.gridLayout_40.setRowMinimumHeight(7, 1) - self.gridLayout_40.setRowMinimumHeight(8, 1) - self.gridLayout_40.setRowMinimumHeight(9, 1) - self.gridLayout_40.setRowMinimumHeight(10, 1) - self.gridLayout_40.setColumnStretch(0, 1) - self.gridLayout_40.setColumnStretch(1, 8) - self.gridLayout_40.setColumnStretch(2, 1) - self.gridLayout_40.setRowStretch(0, 1) - self.gridLayout_40.setRowStretch(1, 1) - self.gridLayout_40.setRowStretch(2, 1) - self.gridLayout_40.setRowStretch(3, 1) - self.gridLayout_40.setRowStretch(4, 1) - self.gridLayout_40.setRowStretch(5, 1) - self.gridLayout_40.setRowStretch(6, 1) - self.gridLayout_40.setRowStretch(7, 1) - self.gridLayout_40.setRowStretch(8, 1) - self.gridLayout_40.setRowStretch(9, 1) - self.gridLayout_40.setRowStretch(10, 5) - self.verticalLayout_3.addWidget(self.widget_2) - self.scrollArea_3.setWidget(self.scrollAreaWidgetContents_3) - self.gridLayout_39.addWidget(self.scrollArea_3, 0, 0, 1, 1) - self.stackedWidget.addWidget(self.page_4) - self.page_5 = QtWidgets.QWidget() - self.page_5.setObjectName("page_5") - self.gridLayout_77 = QtWidgets.QGridLayout(self.page_5) - self.gridLayout_77.setObjectName("gridLayout_77") - self.scrollArea_4 = QtWidgets.QScrollArea(self.page_5) - self.scrollArea_4.setWidgetResizable(True) - self.scrollArea_4.setObjectName("scrollArea_4") - self.scrollAreaWidgetContents_5 = QtWidgets.QWidget() - self.scrollAreaWidgetContents_5.setGeometry(QtCore.QRect(0, 0, 181, 631)) - self.scrollAreaWidgetContents_5.setObjectName("scrollAreaWidgetContents_5") - self.verticalLayout_6 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents_5) - self.verticalLayout_6.setObjectName("verticalLayout_6") - self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents_5) - self.widget_3.setObjectName("widget_3") - self.gridLayout_78 = QtWidgets.QGridLayout(self.widget_3) - self.gridLayout_78.setObjectName("gridLayout_78") - self.groupBox_integral_entrance = QtWidgets.QGroupBox(self.widget_3) - self.groupBox_integral_entrance.setObjectName("groupBox_integral_entrance") - self.gridLayout_85 = QtWidgets.QGridLayout(self.groupBox_integral_entrance) - self.gridLayout_85.setObjectName("gridLayout_85") - self.gridLayout_integral_entrance = QtWidgets.QGridLayout() - self.gridLayout_integral_entrance.setObjectName("gridLayout_integral_entrance") - self.gridLayout_85.addLayout(self.gridLayout_integral_entrance, 0, 0, 1, 1) - self.groupBox_integral_entrance_copywriting = QtWidgets.QGroupBox(self.groupBox_integral_entrance) - self.groupBox_integral_entrance_copywriting.setObjectName("groupBox_integral_entrance_copywriting") - self.gridLayout_82 = QtWidgets.QGridLayout(self.groupBox_integral_entrance_copywriting) - self.gridLayout_82.setObjectName("gridLayout_82") - self.gridLayout_integral_entrance_copywriting = QtWidgets.QGridLayout() - self.gridLayout_integral_entrance_copywriting.setObjectName("gridLayout_integral_entrance_copywriting") - self.gridLayout_82.addLayout(self.gridLayout_integral_entrance_copywriting, 0, 0, 1, 1) - self.gridLayout_85.addWidget(self.groupBox_integral_entrance_copywriting, 1, 0, 1, 1) - self.gridLayout_78.addWidget(self.groupBox_integral_entrance, 3, 0, 1, 1) - self.groupBox_integral_sign = QtWidgets.QGroupBox(self.widget_3) - self.groupBox_integral_sign.setObjectName("groupBox_integral_sign") - self.gridLayout_83 = QtWidgets.QGridLayout(self.groupBox_integral_sign) - self.gridLayout_83.setObjectName("gridLayout_83") - self.gridLayout_integral_sign = QtWidgets.QGridLayout() - self.gridLayout_integral_sign.setObjectName("gridLayout_integral_sign") - self.gridLayout_83.addLayout(self.gridLayout_integral_sign, 0, 0, 1, 1) - self.groupBox_integral_sign_copywriting = QtWidgets.QGroupBox(self.groupBox_integral_sign) - self.groupBox_integral_sign_copywriting.setObjectName("groupBox_integral_sign_copywriting") - self.gridLayout_80 = QtWidgets.QGridLayout(self.groupBox_integral_sign_copywriting) - self.gridLayout_80.setObjectName("gridLayout_80") - self.gridLayout_integral_sign_copywriting = QtWidgets.QGridLayout() - self.gridLayout_integral_sign_copywriting.setObjectName("gridLayout_integral_sign_copywriting") - self.gridLayout_80.addLayout(self.gridLayout_integral_sign_copywriting, 0, 0, 1, 1) - self.gridLayout_83.addWidget(self.groupBox_integral_sign_copywriting, 1, 0, 1, 1) - self.gridLayout_78.addWidget(self.groupBox_integral_sign, 1, 0, 1, 1) - self.groupBox_integral_gift = QtWidgets.QGroupBox(self.widget_3) - self.groupBox_integral_gift.setObjectName("groupBox_integral_gift") - self.gridLayout_84 = QtWidgets.QGridLayout(self.groupBox_integral_gift) - self.gridLayout_84.setObjectName("gridLayout_84") - self.gridLayout_integral_gift = QtWidgets.QGridLayout() - self.gridLayout_integral_gift.setObjectName("gridLayout_integral_gift") - self.gridLayout_84.addLayout(self.gridLayout_integral_gift, 0, 0, 1, 1) - self.groupBox_integral_gift_copywriting = QtWidgets.QGroupBox(self.groupBox_integral_gift) - self.groupBox_integral_gift_copywriting.setObjectName("groupBox_integral_gift_copywriting") - self.gridLayout_81 = QtWidgets.QGridLayout(self.groupBox_integral_gift_copywriting) - self.gridLayout_81.setObjectName("gridLayout_81") - self.gridLayout_integral_gift_copywriting = QtWidgets.QGridLayout() - self.gridLayout_integral_gift_copywriting.setObjectName("gridLayout_integral_gift_copywriting") - self.gridLayout_81.addLayout(self.gridLayout_integral_gift_copywriting, 0, 0, 1, 1) - self.gridLayout_84.addWidget(self.groupBox_integral_gift_copywriting, 1, 0, 1, 1) - self.gridLayout_78.addWidget(self.groupBox_integral_gift, 2, 0, 1, 1) - self.groupBox_integral_crud = QtWidgets.QGroupBox(self.widget_3) - self.groupBox_integral_crud.setObjectName("groupBox_integral_crud") - self.gridLayout_86 = QtWidgets.QGridLayout(self.groupBox_integral_crud) - self.gridLayout_86.setObjectName("gridLayout_86") - self.gridLayout_integral_crud = QtWidgets.QGridLayout() - self.gridLayout_integral_crud.setObjectName("gridLayout_integral_crud") - self.groupBox_integral_crud_query = QtWidgets.QGroupBox(self.groupBox_integral_crud) - self.groupBox_integral_crud_query.setObjectName("groupBox_integral_crud_query") - self.gridLayout_73 = QtWidgets.QGridLayout(self.groupBox_integral_crud_query) - self.gridLayout_73.setObjectName("gridLayout_73") - self.gridLayout_integral_crud_query = QtWidgets.QGridLayout() - self.gridLayout_integral_crud_query.setObjectName("gridLayout_integral_crud_query") - self.gridLayout_73.addLayout(self.gridLayout_integral_crud_query, 0, 0, 1, 1) - self.gridLayout_integral_crud.addWidget(self.groupBox_integral_crud_query, 0, 0, 1, 1) - self.gridLayout_86.addLayout(self.gridLayout_integral_crud, 0, 0, 1, 1) - self.gridLayout_78.addWidget(self.groupBox_integral_crud, 4, 0, 1, 1) - self.groupBox_integral_common = QtWidgets.QGroupBox(self.widget_3) - self.groupBox_integral_common.setObjectName("groupBox_integral_common") - self.gridLayout_79 = QtWidgets.QGridLayout(self.groupBox_integral_common) - self.gridLayout_79.setObjectName("gridLayout_79") - self.gridLayout_integral_common = QtWidgets.QGridLayout() - self.gridLayout_integral_common.setObjectName("gridLayout_integral_common") - self.label_integral_common_enable = QtWidgets.QLabel(self.groupBox_integral_common) - self.label_integral_common_enable.setObjectName("label_integral_common_enable") - self.gridLayout_integral_common.addWidget(self.label_integral_common_enable, 0, 0, 1, 1) - self.checkBox_integral_common_enable = QtWidgets.QCheckBox(self.groupBox_integral_common) - self.checkBox_integral_common_enable.setObjectName("checkBox_integral_common_enable") - self.gridLayout_integral_common.addWidget(self.checkBox_integral_common_enable, 0, 1, 1, 1) - self.gridLayout_integral_common.setColumnStretch(0, 1) - self.gridLayout_integral_common.setColumnStretch(1, 6) - self.gridLayout_79.addLayout(self.gridLayout_integral_common, 0, 0, 1, 1) - self.gridLayout_78.addWidget(self.groupBox_integral_common, 0, 0, 1, 1) - spacerItem44 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum) - self.gridLayout_78.addItem(spacerItem44, 0, 1, 1, 1) - self.gridLayout_78.setColumnStretch(0, 12) - self.gridLayout_78.setColumnStretch(1, 1) - self.verticalLayout_6.addWidget(self.widget_3) - self.scrollArea_4.setWidget(self.scrollAreaWidgetContents_5) - self.gridLayout_77.addWidget(self.scrollArea_4, 0, 0, 1, 1) - self.stackedWidget.addWidget(self.page_5) - self.gridLayout_20.addWidget(self.stackedWidget, 0, 0, 10, 1) - self.pushButton_talk_page = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_talk_page.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_talk_page.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #e6a23c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_talk_page.setObjectName("pushButton_talk_page") - self.gridLayout_20.addWidget(self.pushButton_talk_page, 6, 1, 1, 1) - self.pushButton_integral_page = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_integral_page.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_integral_page.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #e6a23c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_integral_page.setObjectName("pushButton_integral_page") - self.gridLayout_20.addWidget(self.pushButton_integral_page, 7, 1, 1, 1) - self.pushButton_factory = QtWidgets.QPushButton(self.centralwidget) - self.pushButton_factory.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) - self.pushButton_factory.setStyleSheet("border: 1px solid #dcdfe6;\n" -"background-color: #f56c6c;\n" -"text-align: center;\n" -"padding: 12px 16px;\n" -"border-radius: 4px;\n" -"font: 75 12pt \"微软雅黑\";") - self.pushButton_factory.setObjectName("pushButton_factory") - self.gridLayout_20.addWidget(self.pushButton_factory, 9, 1, 1, 1) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 1191, 26)) - self.menubar.setObjectName("menubar") - self.menu_about = QtWidgets.QMenu(self.menubar) - self.menu_about.setObjectName("menu_about") - self.menu = QtWidgets.QMenu(self.menubar) - self.menu.setObjectName("menu") - MainWindow.setMenuBar(self.menubar) - self.statusbar = QtWidgets.QStatusBar(MainWindow) - self.statusbar.setObjectName("statusbar") - MainWindow.setStatusBar(self.statusbar) - self.action_official_store = QtWidgets.QAction(MainWindow) - self.action_official_store.setObjectName("action_official_store") - self.action_video_tutorials = QtWidgets.QAction(MainWindow) - self.action_video_tutorials.setObjectName("action_video_tutorials") - self.action_exit = QtWidgets.QAction(MainWindow) - self.action_exit.setObjectName("action_exit") - self.action_online_doc = QtWidgets.QAction(MainWindow) - self.action_online_doc.setObjectName("action_online_doc") - self.action_about = QtWidgets.QAction(MainWindow) - self.action_about.setObjectName("action_about") - self.action_tip1 = QtWidgets.QAction(MainWindow) - self.action_tip1.setObjectName("action_tip1") - self.action_official_qq_group = QtWidgets.QAction(MainWindow) - self.action_official_qq_group.setObjectName("action_official_qq_group") - self.menu_about.addAction(self.action_official_store) - self.menu_about.addAction(self.action_video_tutorials) - self.menu_about.addAction(self.action_online_doc) - self.menu_about.addAction(self.action_about) - self.menu_about.addSeparator() - self.menu_about.addAction(self.action_tip1) - self.menu_about.addAction(self.action_official_qq_group) - self.menu.addAction(self.action_exit) - self.menubar.addAction(self.menu.menuAction()) - self.menubar.addAction(self.menu_about.menuAction()) - - self.retranslateUi(MainWindow) - self.stackedWidget.setCurrentIndex(0) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - _translate = QtCore.QCoreApplication.translate - MainWindow.setWindowTitle(_translate("MainWindow", "AI Vtuber")) - self.pushButton_run_page.setText(_translate("MainWindow", "②运行页")) - self.pushButton_copywriting_page.setText(_translate("MainWindow", "③文案页")) - self.pushButton_run.setText(_translate("MainWindow", "运行")) - self.pushButton_config_page.setText(_translate("MainWindow", "①配置页")) - self.pushButton_save.setText(_translate("MainWindow", "保存配置")) - self.groupBox_read_comment.setTitle(_translate("MainWindow", "念弹幕")) - self.label_before_prompt.setText(_translate("MainWindow", "提示词前缀")) - self.groupBox_audio_random_speed.setTitle(_translate("MainWindow", "音频随机变速")) - self.label_audio_random_speed_normal_enable.setText(_translate("MainWindow", "普通音频变速")) - self.label_audio_random_speed_normal_speed_min.setText(_translate("MainWindow", "速度下限")) - self.label_audio_random_speed_normal_speed_max.setText(_translate("MainWindow", "速度上限")) - self.checkBox_audio_random_speed_normal_enable.setText(_translate("MainWindow", "启用")) - self.label_audio_random_speed_copywriting_enable.setText(_translate("MainWindow", "文案音频变速")) - self.checkBox_audio_random_speed_copywriting_enable.setText(_translate("MainWindow", "启用")) - self.label_audio_random_speed_copywriting_speed_min.setText(_translate("MainWindow", "速度下限")) - self.label_audio_random_speed_copywriting_speed_max.setText(_translate("MainWindow", "速度上限")) - self.groupBox_read_user_name.setTitle(_translate("MainWindow", "念用户名")) - self.label_read_user_name_reply_before.setText(_translate("MainWindow", "前置回复")) - self.label_read_user_name_enable.setText(_translate("MainWindow", "启用")) - self.checkBox_read_user_name_enable.setText(_translate("MainWindow", "是")) - self.label_read_user_name_voice_change.setText(_translate("MainWindow", "启用变声")) - self.checkBox_read_user_name_voice_change.setText(_translate("MainWindow", "是")) - self.label_read_user_name_reply_after.setText(_translate("MainWindow", "后置回复")) - self.groupBox_play_audio.setTitle(_translate("MainWindow", "音频播放")) - self.label_platform.setText(_translate("MainWindow", "平台")) - self.label_need_lang.setText(_translate("MainWindow", "回复语言")) - self.groupBox_show_box.setTitle(_translate("MainWindow", "自定义显示板块")) - self.groupBox_claude2.setTitle(_translate("MainWindow", "Claude2")) - self.label_claude2_proxies_https.setText(_translate("MainWindow", "https代理地址")) - self.label_claude2_proxies_socks5.setText(_translate("MainWindow", "socks5代理地址")) - self.checkBox_claude2_use_proxy.setText(_translate("MainWindow", "启用")) - self.label_claude2_cookie.setText(_translate("MainWindow", "cookie")) - self.label_claude2_use_proxy.setText(_translate("MainWindow", "启用代理")) - self.label_claude2_proxies_http.setText(_translate("MainWindow", "http代理地址")) - self.groupBox_xuniren.setTitle(_translate("MainWindow", "xuniren")) - self.label_after_prompt.setText(_translate("MainWindow", "提示词后缀")) - self.groupBox_chatglm.setTitle(_translate("MainWindow", "ChatGLM")) - self.label_chatglm_api_ip_port.setText(_translate("MainWindow", "api地址")) - self.label_chatglm_history_max_len.setText(_translate("MainWindow", "最大记忆长度")) - self.label_chatglm_top_p.setText(_translate("MainWindow", "前p个选择")) - self.label_chatglm_temperature.setText(_translate("MainWindow", "温度")) - self.label_chatglm_max_length.setText(_translate("MainWindow", "最大长度限制")) - self.label_chatglm_history_enable.setText(_translate("MainWindow", "上下文记忆")) - self.checkBox_chatglm_history_enable.setText(_translate("MainWindow", "启用")) - self.label_room_display_id.setText(_translate("MainWindow", "直播间号")) - self.groupBox_openai.setTitle(_translate("MainWindow", "openai")) - self.label_openai_api.setText(_translate("MainWindow", "API")) - self.label_openai_api_key.setText(_translate("MainWindow", "API KEY")) - self.label_visual_body.setText(_translate("MainWindow", "虚拟身体")) - self.label_chat_type.setText(_translate("MainWindow", "聊天类型")) - self.groupBox_local_qa.setTitle(_translate("MainWindow", "本地问答")) - self.label_local_qa_audio_enable.setText(_translate("MainWindow", "音频匹配")) - self.label_local_qa_text_enable.setText(_translate("MainWindow", "文本匹配")) - self.checkBox_local_qa_text_enable.setText(_translate("MainWindow", "启用")) - self.label_local_qa_audio_similarity.setText(_translate("MainWindow", "音频最低相似度")) - self.checkBox_local_qa_audio_enable.setText(_translate("MainWindow", "启用")) - self.label_local_qa_text_similarity.setText(_translate("MainWindow", "文本最低相似度")) - self.label_local_qa_audio_file_path.setText(_translate("MainWindow", "音频存储路径")) - self.label_local_qa_text_file_path.setText(_translate("MainWindow", "文本问答数据路径")) - self.label_local_qa_text_type.setText(_translate("MainWindow", "文本问答算法类型")) - self.comboBox_local_qa_text_type.setItemText(0, _translate("MainWindow", "自定义json")) - self.comboBox_local_qa_text_type.setItemText(1, _translate("MainWindow", "一问一答")) - self.groupBox_claude.setTitle(_translate("MainWindow", "Claude")) - self.label_claude_slack_user_token.setText(_translate("MainWindow", "slack_user_token")) - self.label_claude_bot_user_id.setText(_translate("MainWindow", "bot_user_id")) - self.comboBox_need_lang.setItemText(0, _translate("MainWindow", "所有")) - self.comboBox_need_lang.setItemText(1, _translate("MainWindow", "中文")) - self.comboBox_need_lang.setItemText(2, _translate("MainWindow", "英文")) - self.comboBox_need_lang.setItemText(3, _translate("MainWindow", "日文")) - self.groupBox_log.setTitle(_translate("MainWindow", "日志")) - self.comboBox_comment_log_type.setItemText(0, _translate("MainWindow", "问答")) - self.comboBox_comment_log_type.setItemText(1, _translate("MainWindow", "问题")) - self.comboBox_comment_log_type.setItemText(2, _translate("MainWindow", "回答")) - self.comboBox_comment_log_type.setItemText(3, _translate("MainWindow", "不记录")) - self.label_comment_log_type.setText(_translate("MainWindow", "弹幕日志类型")) - self.label_captions_file_path.setText(_translate("MainWindow", "字幕日志路径")) - self.label_captions_enable.setText(_translate("MainWindow", "字幕日志")) - self.checkBox_captions_enable.setText(_translate("MainWindow", "启用")) - self.groupBox_filter.setTitle(_translate("MainWindow", "过滤")) - self.label_filter_talk_forget_reserve_num.setText(_translate("MainWindow", "聊天保留数")) - self.label_filter_comment_forget_reserve_num.setText(_translate("MainWindow", "弹幕保留数")) - self.label_filter_max_len.setText(_translate("MainWindow", "最大单词数")) - self.label_filter_max_char_len.setText(_translate("MainWindow", "最大字符数")) - self.label_filter_entrance_forget_reserve_num.setText(_translate("MainWindow", "入场保留数")) - self.label_filter_talk_forget_duration.setText(_translate("MainWindow", "聊天遗忘间隔")) - self.label_filter_badwords_path.setText(_translate("MainWindow", "违禁词路径")) - self.label_filter_schedule_forget_duration.setText(_translate("MainWindow", "定时遗忘间隔")) - self.label_filter_comment_forget_duration.setText(_translate("MainWindow", "弹幕遗忘间隔")) - self.label_filter_follow_forget_duration.setText(_translate("MainWindow", "关注遗忘间隔")) - self.label_filter_bad_pinyin_path.setText(_translate("MainWindow", "违禁拼音路径")) - self.label_filter_gift_forget_reserve_num.setText(_translate("MainWindow", "礼物保留数")) - self.label_filter_before_must_str.setText(_translate("MainWindow", "弹幕前缀")) - self.label_filter_after_must_str.setText(_translate("MainWindow", "弹幕后缀")) - self.label_filter_schedule_forget_reserve_num.setText(_translate("MainWindow", "定时保留数")) - self.label_filter_gift_forget_duration.setText(_translate("MainWindow", "礼物遗忘间隔")) - self.label_filter_entrance_forget_duration.setText(_translate("MainWindow", "入场遗忘间隔")) - self.label_filter_follow_forget_reserve_num.setText(_translate("MainWindow", "关注保留数")) - self.groupBox_twitch.setTitle(_translate("MainWindow", "twitch")) - self.label_audio_synthesis_type.setText(_translate("MainWindow", "语音合成")) - self.comboBox_chat_type.setItemText(0, _translate("MainWindow", "不启用")) - self.comboBox_chat_type.setItemText(1, _translate("MainWindow", "复读机")) - self.comboBox_chat_type.setItemText(2, _translate("MainWindow", "ChatGPT")) - self.comboBox_chat_type.setItemText(3, _translate("MainWindow", "Claude")) - self.comboBox_chat_type.setItemText(4, _translate("MainWindow", "ChatGLM")) - self.comboBox_chat_type.setItemText(5, _translate("MainWindow", "chat_with_file")) - self.comboBox_chat_type.setItemText(6, _translate("MainWindow", "Chatterbot")) - self.comboBox_chat_type.setItemText(7, _translate("MainWindow", "text-generation-webui")) - self.comboBox_chat_type.setItemText(8, _translate("MainWindow", "讯飞星火")) - self.comboBox_chat_type.setItemText(9, _translate("MainWindow", "Langchain_ChatGLM")) - self.groupBox_bilibili.setTitle(_translate("MainWindow", "哔哩哔哩")) - self.groupBox_thanks.setTitle(_translate("MainWindow", "答谢")) - self.label_thanks_follow_enable.setText(_translate("MainWindow", "关注答谢")) - self.label_thanks_entrance_enable.setText(_translate("MainWindow", "入场欢迎")) - self.label_thanks_entrance_copy.setText(_translate("MainWindow", "入场文案")) - self.label_thanks_follow_copy.setText(_translate("MainWindow", "关注文案")) - self.label_thanks_gift_copy.setText(_translate("MainWindow", "礼物文案")) - self.label_thanks_gift_enable.setText(_translate("MainWindow", "礼物答谢")) - self.checkBox_thanks_gift_enable.setText(_translate("MainWindow", "启用")) - self.label_thanks_lowest_price.setText(_translate("MainWindow", "最低答谢价格")) - self.checkBox_thanks_entrance_enable.setText(_translate("MainWindow", "启用")) - self.checkBox_thanks_follow_enable.setText(_translate("MainWindow", "启用")) - self.groupBox_chatgpt.setTitle(_translate("MainWindow", "chatgpt")) - self.label_chatgpt_model.setText(_translate("MainWindow", "模型")) - self.label_chatgpt_max_tokens.setText(_translate("MainWindow", "最大令牌数")) - self.label_chatgpt_temperature.setText(_translate("MainWindow", "温度")) - self.label_chatgpt_top_p.setText(_translate("MainWindow", "前p个选择")) - self.label_chatgpt_frequency_penalty.setText(_translate("MainWindow", "频率惩罚")) - self.label_chatgpt_presence_penalty.setText(_translate("MainWindow", "存在惩罚")) - self.label_chatgpt_preset.setText(_translate("MainWindow", "预设")) - self.comboBox_chatgpt_model.setItemText(0, _translate("MainWindow", "gpt-3.5-turbo")) - self.comboBox_chatgpt_model.setItemText(1, _translate("MainWindow", "gpt-3.5-turbo-0301")) - self.comboBox_chatgpt_model.setItemText(2, _translate("MainWindow", "gpt-3.5-turbo-0613")) - self.comboBox_chatgpt_model.setItemText(3, _translate("MainWindow", "gpt-3.5-turbo-16k")) - self.comboBox_chatgpt_model.setItemText(4, _translate("MainWindow", "gpt-3.5-turbo-16k-0613")) - self.comboBox_chatgpt_model.setItemText(5, _translate("MainWindow", "gpt-4")) - self.comboBox_chatgpt_model.setItemText(6, _translate("MainWindow", "gpt-4-0314")) - self.comboBox_chatgpt_model.setItemText(7, _translate("MainWindow", "gpt-4-0613")) - self.comboBox_chatgpt_model.setItemText(8, _translate("MainWindow", "gpt-4-32k")) - self.comboBox_chatgpt_model.setItemText(9, _translate("MainWindow", "gpt-4-32k-0314")) - self.comboBox_chatgpt_model.setItemText(10, _translate("MainWindow", "gpt-4-32k-0613")) - self.comboBox_chatgpt_model.setItemText(11, _translate("MainWindow", "text-embedding-ada-002")) - self.comboBox_chatgpt_model.setItemText(12, _translate("MainWindow", "text-davinci-003")) - self.comboBox_chatgpt_model.setItemText(13, _translate("MainWindow", "text-davinci-002")) - self.comboBox_chatgpt_model.setItemText(14, _translate("MainWindow", "text-curie-001")) - self.comboBox_chatgpt_model.setItemText(15, _translate("MainWindow", "text-babbage-001")) - self.comboBox_chatgpt_model.setItemText(16, _translate("MainWindow", "text-ada-001")) - self.comboBox_chatgpt_model.setItemText(17, _translate("MainWindow", "text-moderation-latest")) - self.comboBox_chatgpt_model.setItemText(18, _translate("MainWindow", "text-moderation-stable")) - self.groupBox_audio_player.setTitle(_translate("MainWindow", "audio_player")) - self.groupBox_zhipu.setTitle(_translate("MainWindow", "智谱AI")) - self.groupBox_langchain_chatglm.setTitle(_translate("MainWindow", "Langchain_ChatGLM")) - self.label_langchain_chatglm_api_ip_port.setText(_translate("MainWindow", "api地址")) - self.label_langchain_chatglm_chat_type.setText(_translate("MainWindow", "聊天类型")) - self.label_langchain_chatglm_history_enable.setText(_translate("MainWindow", "上下文记忆")) - self.checkBox_langchain_chatglm_history_enable.setText(_translate("MainWindow", "启用")) - self.label_langchain_chatglm_knowledge_base_id.setText(_translate("MainWindow", "知识库名称")) - self.label_langchain_chatglm_history_max_len.setText(_translate("MainWindow", "最大记忆长度")) - self.groupBox_chat_with_file.setTitle(_translate("MainWindow", "chat_with_file")) - self.label_chat_with_file_local_vector_embedding_model.setText(_translate("MainWindow", "模型")) - self.label_chat_with_file_data_path.setText(_translate("MainWindow", "pdf文件路径")) - self.label_chat_with_file_show_token_cost.setText(_translate("MainWindow", "显示成本")) - self.label_chat_with_file_chat_mode.setText(_translate("MainWindow", "聊天模式")) - self.label_chat_with_file_local_max_query.setText(_translate("MainWindow", "最大查询数据库次数")) - self.label_chat_with_file_question_prompt.setText(_translate("MainWindow", "问题总结提示词")) - self.label_chat_with_file_chunk_size.setText(_translate("MainWindow", "块大小")) - self.label_chat_with_file_chain_type.setText(_translate("MainWindow", "链类型")) - self.checkBox_chat_with_file_show_token_cost.setText(_translate("MainWindow", "启用")) - self.comboBox_chat_with_file_chat_mode.setItemText(0, _translate("MainWindow", "claude")) - self.comboBox_chat_with_file_chat_mode.setItemText(1, _translate("MainWindow", "openai_gpt")) - self.comboBox_chat_with_file_chat_mode.setItemText(2, _translate("MainWindow", "openai_vector_search")) - self.label_chat_with_file_separator.setText(_translate("MainWindow", "分隔符")) - self.label_chat_with_file_chunk_overlap.setText(_translate("MainWindow", "块重叠")) - self.comboBox_chat_with_file_local_vector_embedding_model.setItemText(0, _translate("MainWindow", "sebastian-hofstaetter/distilbert-dot-tas_b-b256-msmarco")) - self.comboBox_chat_with_file_local_vector_embedding_model.setItemText(1, _translate("MainWindow", "GanymedeNil/text2vec-large-chinese")) - self.groupBox_text_generation_webui.setTitle(_translate("MainWindow", "text-generation-webui")) - self.label_text_generation_webui_max_new_tokens.setText(_translate("MainWindow", "max_new_tokens")) - self.label_text_generation_webui_character.setText(_translate("MainWindow", "角色")) - self.label_text_generation_webui_api_ip_port.setText(_translate("MainWindow", "api地址")) - self.label_text_generation_webui_instruction_template.setText(_translate("MainWindow", "instruction_template")) - self.label_text_generation_webui_mode.setText(_translate("MainWindow", "模式")) - self.label_text_generation_webui_your_name.setText(_translate("MainWindow", "你的名字")) - self.groupBox_sparkdesk.setTitle(_translate("MainWindow", "讯飞星火")) - self.label_sparkdesk_api_key.setText(_translate("MainWindow", "api_key")) - self.label_sparkdesk_api_secret.setText(_translate("MainWindow", "api_secret")) - self.label_sparkdesk_cookie.setText(_translate("MainWindow", "cookie")) - self.label_sparkdesk_type.setText(_translate("MainWindow", "类型")) - self.label_sparkdesk_app_id.setText(_translate("MainWindow", "app_id")) - self.label_sparkdesk_fd.setText(_translate("MainWindow", "fd")) - self.label_sparkdesk_GtToken.setText(_translate("MainWindow", "GtToken")) - self.label_sparkdesk_version.setText(_translate("MainWindow", "版本")) - self.groupBox_bard.setTitle(_translate("MainWindow", "Bard")) - self.groupBox_yiyan.setTitle(_translate("MainWindow", "文心一言")) - self.groupBox_tongyi.setTitle(_translate("MainWindow", "通义千问")) - self.groupBox_chatterbot.setTitle(_translate("MainWindow", "Chatterbot")) - self.label_chatterbot_name.setText(_translate("MainWindow", "bot名称")) - self.label_chatterbot_db_path.setText(_translate("MainWindow", "数据库路径")) - self.groupBox_edge_tts.setTitle(_translate("MainWindow", "Edge-TTS")) - self.label_edge_tts_rate.setText(_translate("MainWindow", "语速增益")) - self.label_edge_tts_voice.setText(_translate("MainWindow", "说话人")) - self.label_edge_tts_volume.setText(_translate("MainWindow", "音量增益")) - self.groupBox_vits.setTitle(_translate("MainWindow", "VITS")) - self.groupBox_vits_fast.setTitle(_translate("MainWindow", "VITS-Fast")) - self.label_vits_fast_config_path.setText(_translate("MainWindow", "配置文件路径")) - self.label_vits_fast_speed.setText(_translate("MainWindow", "语速")) - self.label_vits_fast_character.setText(_translate("MainWindow", "说话人")) - self.label_vits_fast_api_ip_port.setText(_translate("MainWindow", "API地址")) - self.label_vits_fast_language.setText(_translate("MainWindow", "语言")) - self.comboBox_vits_fast_language.setItemText(0, _translate("MainWindow", "自动识别")) - self.comboBox_vits_fast_language.setItemText(1, _translate("MainWindow", "日本語")) - self.comboBox_vits_fast_language.setItemText(2, _translate("MainWindow", "简体中文")) - self.comboBox_vits_fast_language.setItemText(3, _translate("MainWindow", "English")) - self.comboBox_vits_fast_language.setItemText(4, _translate("MainWindow", "Mix")) - self.groupBox_genshinvoice_top.setTitle(_translate("MainWindow", "genshinvoice_top")) - self.label_genshinvoice_top_speaker.setText(_translate("MainWindow", "角色")) - self.label_genshinvoice_top_noisew.setText(_translate("MainWindow", "音素长度")) - self.label_genshinvoice_top_format.setText(_translate("MainWindow", "格式")) - self.label_genshinvoice_top_length.setText(_translate("MainWindow", "语速")) - self.label_genshinvoice_top_noise.setText(_translate("MainWindow", "感情")) - self.label_genshinvoice_top_language.setText(_translate("MainWindow", "语言")) - self.groupBox_elevenlabs.setTitle(_translate("MainWindow", "elevenlabs")) - self.label_elevenlabs_voice.setText(_translate("MainWindow", "说话人")) - self.label_elevenlabs_api_key.setText(_translate("MainWindow", "api密钥")) - self.label_elevenlabs_model.setText(_translate("MainWindow", "模型")) - self.groupBox_bark_gui.setTitle(_translate("MainWindow", "bark-gui")) - self.label_bark_gui_api_ip_port.setText(_translate("MainWindow", "API地址")) - self.label_bark_gui_quick_generation.setText(_translate("MainWindow", "快速生成")) - self.label_bark_gui_batch_count.setText(_translate("MainWindow", "批量数")) - self.label_bark_gui_end_of_sentence_probability.setText(_translate("MainWindow", "句末概率")) - self.label_bark_gui_seed.setText(_translate("MainWindow", "随机种子")) - self.label_bark_gui_generation_temperature.setText(_translate("MainWindow", "生成温度")) - self.label_bark_gui_waveform_temperature.setText(_translate("MainWindow", "波形温度")) - self.label_bark_gui_spk.setText(_translate("MainWindow", "说话人")) - self.checkBox_bark_gui_quick_generation.setText(_translate("MainWindow", "启用")) - self.groupBox_vall_e_x.setTitle(_translate("MainWindow", "VALL-E-X")) - self.groupBox_openai_tts.setTitle(_translate("MainWindow", "OpenAI TTS")) - self.groupBox_live2d.setTitle(_translate("MainWindow", "Live2D")) - self.checkBox_live2d_enable.setText(_translate("MainWindow", "是")) - self.label_live2d_port.setText(_translate("MainWindow", "端口")) - self.label_live2d_enable.setText(_translate("MainWindow", "启用")) - self.label_live2d_name.setText(_translate("MainWindow", "模型名")) - self.groupBox_choose_song.setTitle(_translate("MainWindow", "点歌模式")) - self.label_choose_song_stop_cmd.setText(_translate("MainWindow", "取消点歌命令")) - self.label_choose_song_song_path.setText(_translate("MainWindow", "歌曲路径")) - self.checkBox_choose_song_enable.setText(_translate("MainWindow", "是")) - self.label_choose_song_start_cmd.setText(_translate("MainWindow", "点歌触发命令")) - self.label_choose_song_enable.setText(_translate("MainWindow", "启用")) - self.label_choose_song_match_fail_copy.setText(_translate("MainWindow", "匹配失败文案")) - self.label_choose_song_random_cmd.setText(_translate("MainWindow", "随机点歌命令")) - self.groupBox_schedule.setTitle(_translate("MainWindow", "定时任务")) - self.groupBox_idle_time_task.setTitle(_translate("MainWindow", "闲时任务")) - self.groupBox_idle_time_task_comment.setTitle(_translate("MainWindow", "LLM模式")) - self.groupBox_idle_time_task_local_audio.setTitle(_translate("MainWindow", "本地音频模式")) - self.groupBox_ddsp_svc.setTitle(_translate("MainWindow", "DDSP_SVC")) - self.label_ddsp_svc_enable.setText(_translate("MainWindow", "启用")) - self.label_ddsp_svc_fSafePrefixPadLength.setText(_translate("MainWindow", "安全前缀填充长度")) - self.checkBox_ddsp_svc_enable.setText(_translate("MainWindow", "是")) - self.label_ddsp_svc_api_ip_port.setText(_translate("MainWindow", "API地址")) - self.label_ddsp_svc_config_path.setText(_translate("MainWindow", "配置文件路径")) - self.label_ddsp_svc_sSpeakId.setText(_translate("MainWindow", "说话人ID")) - self.label_ddsp_svc_fPitchChange.setText(_translate("MainWindow", "变调")) - self.label_ddsp_svc_sampleRate.setText(_translate("MainWindow", "采样率")) - self.groupBox_so_vits_svc.setTitle(_translate("MainWindow", "so-vits-svc")) - self.checkBox_so_vits_svc_enable.setText(_translate("MainWindow", "是")) - self.label_so_vits_svc_config_path.setText(_translate("MainWindow", "配置文件路径")) - self.label_so_vits_svc_api_ip_port.setText(_translate("MainWindow", "API地址")) - self.label_so_vits_svc_enable.setText(_translate("MainWindow", "启用")) - self.label_so_vits_svc_spk.setText(_translate("MainWindow", "说话人")) - self.label_so_vits_svc_tran.setText(_translate("MainWindow", "音调")) - self.label_so_vits_svc_wav_format.setText(_translate("MainWindow", "输出音频格式")) - self.groupBox_sd.setTitle(_translate("MainWindow", "Stable Diffusion")) - self.label_sd_port.setText(_translate("MainWindow", "端口")) - self.label_sd_enable_hr.setText(_translate("MainWindow", "高分辨率生成")) - self.label_sd_hr_scale.setText(_translate("MainWindow", "高分辨率缩放因子")) - self.label_sd_hr_resize_x.setText(_translate("MainWindow", "图像水平像素")) - self.label_sd_hr_second_pass_steps.setText(_translate("MainWindow", "高分生二次传递步数")) - self.label_sd_denoising_strength.setText(_translate("MainWindow", "去噪强度")) - self.label_prompt_llm_type.setText(_translate("MainWindow", "LLM类型")) - self.label_prompt_llm_before_prompt.setText(_translate("MainWindow", "提示词前缀")) - self.checkBox_sd_enable_hr.setText(_translate("MainWindow", "启用")) - self.label_sd_trigger.setText(_translate("MainWindow", "弹幕触发前缀")) - self.label_sd_ip.setText(_translate("MainWindow", "IP地址")) - self.label_sd_steps.setText(_translate("MainWindow", "生成图像步数")) - self.label_sd_seed.setText(_translate("MainWindow", "随机种子")) - self.label_sd_styles.setText(_translate("MainWindow", "图像风格")) - self.label_sd_enable.setText(_translate("MainWindow", "启用")) - self.label_sd_cfg_scale.setText(_translate("MainWindow", "提示词相关性")) - self.label_sd_hr_resize_y.setText(_translate("MainWindow", "图像垂直像素")) - self.checkBox_sd_enable.setText(_translate("MainWindow", "是")) - self.label_sd_negative_prompt.setText(_translate("MainWindow", "负面提示词")) - self.label_prompt_llm_after_prompt.setText(_translate("MainWindow", "提示词后缀")) - self.groupBox_trends_copywriting.setTitle(_translate("MainWindow", "动态文案")) - self.label_trends_copywriting_random_play.setText(_translate("MainWindow", "随机播放")) - self.checkBox_trends_copywriting_random_play.setText(_translate("MainWindow", "启用")) - self.label_trends_copywriting_play_interval.setText(_translate("MainWindow", "文案播放间隔")) - self.label_trends_copywriting_enable.setText(_translate("MainWindow", "启用")) - self.checkBox_trends_copywriting_enable.setText(_translate("MainWindow", "是")) - self.groupBox_header.setTitle(_translate("MainWindow", "请求头")) - self.label_header_useragent.setText(_translate("MainWindow", "userAgent")) - self.lineEdit_header_useragent.setText(_translate("MainWindow", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42")) - self.groupBox_web_captions_printer.setTitle(_translate("MainWindow", "web字幕打印机")) - self.groupBox_database.setTitle(_translate("MainWindow", "数据库")) - self.groupBox_key_mapping.setTitle(_translate("MainWindow", "按键映射")) - self.checkBox_key_mapping_enable.setText(_translate("MainWindow", "是")) - self.label_key_mapping_enable.setText(_translate("MainWindow", "启用")) - self.label_key_mapping_start_cmd.setText(_translate("MainWindow", "命令前缀")) - self.label_key_mapping_type.setText(_translate("MainWindow", "类型")) - self.groupBox_unity.setTitle(_translate("MainWindow", "Unity")) - self.textBrowser.setHtml(_translate("MainWindow", "\n" -"\n" -"


")) - self.label_copywriting_edit.setText(_translate("MainWindow", "编辑文案")) - self.pushButton_copywriting_save.setText(_translate("MainWindow", "保存文案")) - self.pushButton_copywriting_config_index_add.setText(_translate("MainWindow", "增加")) - self.label_copywriting_config_index.setText(_translate("MainWindow", "文案编号")) - self.pushButton_copywriting_config_index_del.setText(_translate("MainWindow", "删除")) - self.pushButton_copywriting_pause_play.setText(_translate("MainWindow", "暂停播放")) - self.pushButton_copywriting_synthetic_audio.setText(_translate("MainWindow", "合成音频")) - self.pushButton_copywriting_loop_play.setText(_translate("MainWindow", "循环播放")) - self.pushButton_copywriting_refresh_list.setText(_translate("MainWindow", "刷新列表")) - self.label_copywriting_select.setText(_translate("MainWindow", "选择文案")) - self.label_copywriting_switching_random_play.setText(_translate("MainWindow", "音频随机播放")) - self.label_copywriting_audio_interval.setText(_translate("MainWindow", "音频播放间隔")) - self.pushButton_copywriting_select.setText(_translate("MainWindow", "加载")) - self.checkBox_copywriting_switching_random_play.setText(_translate("MainWindow", "启用")) - self.label_copywriting_switching_interval.setText(_translate("MainWindow", "音频切换间隔")) - self.label_copywriting_switching_auto_play.setText(_translate("MainWindow", "自动播放")) - self.checkBox_copywriting_switching_auto_play.setText(_translate("MainWindow", "启用")) - self.checkBox_talk_continuous_talk.setText(_translate("MainWindow", "启用")) - self.label_talk_continuous_talk.setText(_translate("MainWindow", "连续对话")) - self.label_talk_username.setText(_translate("MainWindow", "你的名字")) - self.pushButton_talk_chat_box_reread.setText(_translate("MainWindow", "直接复读")) - self.groupBox_talk_google.setTitle(_translate("MainWindow", "谷歌")) - self.label_talk_google_tgt_lang.setText(_translate("MainWindow", "目标翻译语言")) - self.pushButton_talk_chat_box_send.setText(_translate("MainWindow", "发送")) - self.label_talk_silence_threshold.setText(_translate("MainWindow", "沉默阈值")) - self.label_talk_stop_trigger_key.setText(_translate("MainWindow", "停录按键")) - self.label_talk_trigger_key.setText(_translate("MainWindow", "录音按键")) - self.label_talk_volume_threshold.setText(_translate("MainWindow", "音量阈值")) - self.label_talk_type.setText(_translate("MainWindow", "录音类型")) - self.label_talk_chat_box.setText(_translate("MainWindow", "聊天框")) - self.groupBox_talk_baidu.setTitle(_translate("MainWindow", "百度")) - self.label_talk_baidu_app_id.setText(_translate("MainWindow", "AppID")) - self.label_talk_baidu_api_key.setText(_translate("MainWindow", "API Key")) - self.label_talk_baidu_secret_key.setText(_translate("MainWindow", "Secret Key")) - self.groupBox_integral_entrance.setTitle(_translate("MainWindow", "入场")) - self.groupBox_integral_entrance_copywriting.setTitle(_translate("MainWindow", "文案")) - self.groupBox_integral_sign.setTitle(_translate("MainWindow", "签到")) - self.groupBox_integral_sign_copywriting.setTitle(_translate("MainWindow", "文案")) - self.groupBox_integral_gift.setTitle(_translate("MainWindow", "礼物")) - self.groupBox_integral_gift_copywriting.setTitle(_translate("MainWindow", "文案")) - self.groupBox_integral_crud.setTitle(_translate("MainWindow", "增删改查")) - self.groupBox_integral_crud_query.setTitle(_translate("MainWindow", "查询")) - self.groupBox_integral_common.setTitle(_translate("MainWindow", "通用")) - self.label_integral_common_enable.setText(_translate("MainWindow", "启用")) - self.checkBox_integral_common_enable.setText(_translate("MainWindow", "是")) - self.pushButton_talk_page.setText(_translate("MainWindow", "④聊天页")) - self.pushButton_integral_page.setText(_translate("MainWindow", "⑤积分页")) - self.pushButton_factory.setText(_translate("MainWindow", "恢复出厂配置")) - self.menu_about.setTitle(_translate("MainWindow", "帮助")) - self.menu.setTitle(_translate("MainWindow", "文件")) - self.action_official_store.setText(_translate("MainWindow", "官方仓库")) - self.action_video_tutorials.setText(_translate("MainWindow", "视频教程")) - self.action_exit.setText(_translate("MainWindow", "退出")) - self.action_online_doc.setText(_translate("MainWindow", "在线文档")) - self.action_about.setText(_translate("MainWindow", "关于")) - self.action_tip1.setText(_translate("MainWindow", "本软件完全免费")) - self.action_official_qq_group.setText(_translate("MainWindow", "官方Q群:587663288")) diff --git a/main-old.py b/main-old.py deleted file mode 100644 index 3f976fda..00000000 --- a/main-old.py +++ /dev/null @@ -1,4979 +0,0 @@ -import sys, os, json, subprocess, importlib, re, threading, signal -import logging, traceback -import time -import asyncio -# from functools import partial - -from utils.config import Config - -from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox, QLabel, QComboBox, QLineEdit, QTextEdit, QCheckBox, QGroupBox -from PyQt5.QtGui import QFont, QDesktopServices, QIcon, QPixmap -from PyQt5.QtCore import QTimer, QThread, QEventLoop, pyqtSignal, QUrl, Qt, QEvent - -import http.server -import socketserver - -import UI_main - -from utils.common import Common -from utils.logger import Configure_logger -from utils.audio import Audio - -""" - -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@.:;;;++;;;;:,@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@:;+++++;;++++;;;.@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@:++++;;;;;;;;;;+++;,@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@.;+++;;;;;;;;;;;;;;++;:@@@@@@@@@@@@@@@@ -@@@@@@@@@@;+++;;;;;;;;;;;;;;;;;;++;:@@@@@@@@@@@@@@ -@@@@@@@@@:+++;;;;;;;;;;;;;;;;;;;;++;.@@@@@@@@@@@@@ -@@@@@@@@;;+;;;;;;;;;;;;;;;;;;;;;;;++:@@@@@@@@@@@@@ -@@@@@@@@;+;;;;:::;;;;;;;;;;;;;;;;:;+;,@@@@@@@@@@@@ -@@@@@@@:+;;:;;:::;:;;:;;;;::;;:;:::;+;.@@@@@@@@@@@ -@@@@@@.;+;::;:,:;:;;+:++:;:::+;:::::++:+@@@@@@@@@@ -@@@@@@:+;;:;;:::;;;+%;*?;;:,:;*;;;;:;+;:@@@@@@@@@@ -@@@@@@;;;+;;+;:;;;+??;*?++;,:;+++;;;:++:@@@@@@@@@@ -@@@@@.++*+;;+;;;;+?;?**??+;:;;+.:+;;;;+;;@@@@@@@@@ -@@@@@,+;;;;*++*;+?+;**;:?*;;;;*:,+;;;;+;,@@@@@@@@@ -@@@@@,:,+;+?+?++?+;,?#%*??+;;;*;;:+;;;;+:@@@@@@@@@ -@@@@@@@:+;*?+?#%;;,,?###@#+;;;*;;,+;;;;+:@@@@@@@@@ -@@@@@@@;+;??+%#%;,,,;SSS#S*+++*;..:+;?;+;@@@@@@@@@ -@@@@@@@:+**?*?SS,,,,,S#S#+***?*;..;?;**+;@@@@@@@@@ -@@@@@@@:+*??*??S,,,,,*%SS+???%++;***;+;;;.@@@@@@@@ -@@@@@@@:*?*;*+;%:,,,,;?S?+%%S?%+,:?;+:,,,@@@@@@@@ -@@@@@@@,*?,;+;+S:,,,,%?+;S%S%++:+??+:,,,:@@@@@@@@ -@@@@@@@,:,@;::;+,,,,,+?%*+S%#?*???*;,,,,,.@@@@@@@@ -@@@@@@@@:;,::;;:,,,,,,,,,?SS#??*?+,.,,,:,@@@@@@@@@ -@@@@@@;;+;;+:,:%?%*;,,,,SS#%*??%,.,,,,,:@@@@@@@@@ -@@@@@.+++,++:;???%S?%;.+#####??;.,,,,,,:@@@@@@@@@ -@@@@@:++::??+S#??%#??S%?#@#S*+?*,,,,,,:,@@@@@@@@@@ -@@@@@:;;:*?;+%#%?S#??%SS%+#%..;+:,,,,,,@@@@@@@@@@@ -@@@@@@,,*S*;?SS?%##%?S#?,.:#+,,+:,,,,,,@@@@@@@@@@@ -@@@@@@@;%?%#%?*S##??##?,..*#,,+:,,;*;.@@@@@@@@@@@ -@@@@@@.*%??#S*?S#@###%;:*,.:#:,+;:;*+:@@@@@@@@@@@@ -@@@@@@,%S??SS%##@@#%S+..;;.,#*;???*?+++:@@@@@@@@@@ -@@@@@@:S%??%####@@S,,*,.;*;+#*;+?%??#S%+.@@@@@@@@@ -@@@@@@:%???%@###@@?,,:**S##S*;.,%S?;+*?+.,..@@@@@@ -@@@@@@;%??%#@###@@#:.;@@#@%%,.,%S*;++*++++;.@@@@@ -@@@@@@,%S?S@@###@@@%+#@@#@?;,.:?;??++?%?***+.@@@@@ -@@@@@@.*S?S####@@####@@##@?..:*,+:??**%+;;;;..@@@@ -@@@@@@:+%?%####@@####@@#@%;:.;;:,+;?**;++;,:;:,@@@ -@@@@@@;;*%?%@##@@@###@#S#*:;*+,;.+***?******+:.@@@ -@@@@@@:;:??%@###%##@#%++;+*:+;,:;+%?*;+++++;:.@@@@ -@@@@@@.+;:?%@@#%;+S*;;,:::**+,;:%??*+.@....@@@@@@@ -@@@@@@@;*::?#S#S+;,..,:,;:?+?++*%?+::@@@@@@@@@@@@@ -@@@@@@@.+*+++?%S++...,;:***??+;++:.@@@@@@@@@@@@@@@ -@@@@@@@@:::..,;+*+;;+*?**+;;;+;:.@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@,+*++;;:,..@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@::,.@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ - -""" - - -class AI_VTB(QMainWindow): - proxy = None - # proxy = { - # "http": "http://127.0.0.1:10809", - # "https": "http://127.0.0.1:10809" - # } - - # 平台端线程 - platform_thread = None - # 平台端进程 - platform_process = None - - terminate_event = threading.Event() - _instance = None - - # 单例模式 - def __new__(cls, *args, **kwargs): - if cls._instance is None: - cls._instance = super(AI_VTB, cls).__new__(cls, *args, **kwargs) - return cls._instance - - - ''' - 初始化 - ''' - def __init__(self): - logging.info("程序开始运行") - - self.app = QApplication(sys.argv) - super().__init__() - self.ui = UI_main.Ui_MainWindow() - self.ui.setupUi(self) - - # 获取显示器分辨率 - self.desktop = QApplication.desktop() - self.screenRect = self.desktop.screenGeometry() - self.screenheight = self.screenRect.height() - self.screenwidth = self.screenRect.width() - - logging.debug("Screen height {}".format(self.screenheight)) - logging.debug("Screen width {}".format(self.screenwidth)) - - # self.height = int(self.screenheight * 0.7) - # self.width = int(self.screenwidth * 0.7) - - # 设置软件图标 - app_icon = QIcon("ui/icon.png") - self.setWindowIcon(app_icon) - - # self.resize(self.width, self.height) - - # 页面索引 - self.stackedWidget_index = 0 - - # 调用设置背景图的方法 - self.set_background() - - # 设置实例 - self.CreateItems() - # 读取配置文件 进行初始化 - self.init_config() - # 初始化 - self.init_ui() - - - # 设置背景图 - def set_background(self): - # 创建一个 QLabel 用于显示背景图 - background_label = QLabel(self) - - # 加载背景图,替换 'background.jpg' 为你的图片路径 - pixmap = QPixmap('ui/bg.png') - - screen = QApplication.primaryScreen() - screen_size = screen.size() - - # 计算缩放比例,使图片等比缩放至全屏 - scaled_pixmap = pixmap.scaled(screen_size, aspectRatioMode=Qt.KeepAspectRatio) - - # 设置 Label 大小为窗口大小 - background_label.setPixmap(scaled_pixmap) - - # 高度减一点,顶部菜单栏覆盖不到,什么dio问题 - background_label.setGeometry(0, 0, screen_size.width(), screen_size.height() - 15) - - # 让 Label 放置在顶层,成为背景 - background_label.lower() - - - # 关闭窗口 - def closeEvent(self, event): - global web_server_thread - - AI_VTB.terminate_event.set() - - if AI_VTB.platform_process: - # 终止进程 - AI_VTB.platform_process.terminate() - - if AI_VTB.platform_thread: - # 停止线程 - AI_VTB.platform_thread.terminate() - - if config.get("live2d", "enable"): - web_server_thread.terminate() - - # 关闭窗口 - event.accept() - - - # 设置实例 - def CreateItems(self): - # 定时器 - self.timer = QTimer(self) - self.eventLoop = QEventLoop(self) - - # self.timer_connection = None - - - # 过滤 QComboBox 的选项并更新 - def filter_combobox(self, combo_box, text, manual_clear=True): - if manual_clear: - combo_box.lineEdit().textChanged.disconnect() # 断开信号连接 - combo_box.clear() - - # print(text) - - if text: - matching_items = [item for item in combo_box.original_items if text.lower() in item.lower()] - combo_box.addItems(matching_items) - elif text == '': - combo_box.addItems(combo_box.original_items) - - # combo_box.setCurrentIndex(-1) # 将当前索引设置为 -1,以取消选择 - - combo_box.lineEdit().textChanged.connect(lambda text, combo=combo_box: self.filter_combobox(combo, text, manual_clear=True)) - - - # 从json数据中动态创建widgets - def create_widgets_from_json(self, data): - widgets = [] - - for item in data: - # logging.info(item) - - if item["label_text"] != "": - label_text = item["label_text"] - label = QLabel(label_text) - label.setToolTip(item["label_tip"]) - widgets.append(label) - - data_type = type(item["data"]) - - # 是否限定了widget的类型 - if "widget_type" in item: - if item["widget_type"] == "combo_box": - widget = QComboBox() - # 允许编辑 - widget.setEditable(True) - # 添加多个item - widget.addItems(item["combo_data_list"]) - # data必须在list中,不然,报错咯 - widget.setCurrentIndex(item["combo_data_list"].index(item["data"])) - - widget.original_items = item["combo_data_list"] - - # 设置下拉列表的对象名称 - widget.setObjectName(item["main_obj_name"] + "_QComboBox_" + str(item["index"])) - - widget.lineEdit().textChanged.connect(lambda text, combo=widget: self.filter_combobox(combo, text, True)) - else: - # 根据数据类型,自动生成对应类实例 - if data_type == str or data_type == int or data_type == float: - widget = QLineEdit() - widget.setText(str(item["data"])) - widget.setObjectName(item["main_obj_name"] + "_QLineEdit_" + str(item["index"])) - elif data_type == bool: - widget = QCheckBox() - if item["widget_text"] == "": - widget.setText("启用") - else: - widget.setText(item["widget_text"]) - widget.setChecked(item["data"]) - widget.setObjectName(item["main_obj_name"] + "_QCheckBox_" + str(item["index"])) - - if item["click_func"] == "show_box": - widget.disconnect() - # 连接点击信号到槽函数 - widget.clicked.connect(lambda state, text=item["main_obj_name"]: self.show_box_clicked(state, text)) - # 直接运行恢复显隐状态 - self.show_box_clicked(item["data"], item["main_obj_name"]) - - elif data_type == list: - widget = QTextEdit() - - tmp_str = "" - for tmp in item["data"]: - tmp_str = tmp_str + tmp + "\n" - widget.setText(tmp_str) - widget.setObjectName(item["main_obj_name"] + "_QTextEdit_" + str(item["index"])) - - # 判断readonly是否存在 - if item.get("readonly") is not None: - widget.setReadOnly(item["readonly"]) - - widgets.append(widget) - - return widgets - - - # 从gridLayout中读取所有的widget,返回widget列表 - def read_widgets_from_gridLayout(self, gridLayout): - widgets = [] - for row in range(gridLayout.rowCount()): - for col in range(gridLayout.columnCount()): - widget_item = gridLayout.itemAtPosition(row, col) - if widget_item is not None: - widget = widget_item.widget() - if widget is not None: - widgets.append(widget) - return widgets - - - # 从gridLayout的widgets中获取数据到data - def update_data_from_gridLayout(self, gridLayout, type=""): - widgets = self.read_widgets_from_gridLayout(gridLayout) - logging.debug(widgets) - - data = {} - - for index, widget in enumerate(widgets): - if isinstance(widget, QLineEdit): - # data["QLineEdit_" + str(index)] = widget.text() - data[str(index)] = widget.text() - elif isinstance(widget, QCheckBox): - if type == "show_box": - data[widget.objectName()] = widget.isChecked() - else: - # data["QCheckBox_" + str(index)] = widget.isChecked() - data[str(index)] = widget.isChecked() - elif isinstance(widget, QTextEdit): - data_list = widget.toPlainText().splitlines() - # data["QTextEdit_" + str(index)] = data_list - data[str(index)] = data_list - elif isinstance(widget, QComboBox): - # data["QComboBox_" + str(index)] = widget.text() - data[str(index)] = widget.currentText() - - logging.debug(data) - - return data - - - # 读取配置文件 进行初始化(开始堆shi喵) - def init_config(self): - global config, config_path - - # 如果配置文件不存在,创建一个新的配置文件 - if not os.path.exists(config_path): - logging.error("配置文件不存在!!!请恢复") - self.show_message_box("错误", f"配置文件不存在!!!请恢复", QMessageBox.Critical) - os._exit(0) - - - config = Config(config_path) - - - try: - # 运行标志位,避免重复运行 - self.running_flag = 0 - - # 设置会话初始值 - self.session_config = {'msg': [{"role": "system", "content": config.get('chatgpt', 'preset')}]} - self.sessions = {} - self.current_key_index = 0 - - self.platform = config.get("platform") - - # 直播间号 - self.room_id = config.get("room_display_id") - - self.before_prompt = config.get("before_prompt") - self.after_prompt = config.get("after_prompt") - - self.comment_log_type = config.get("comment_log_type") - - # 日志 - self.captions_config = config.get("captions") - - # 本地问答 - self.local_qa_config = config.get("local_qa") - - # 过滤配置 - self.filter_config = config.get("filter") - - # 答谢 - self.thanks_config = config.get("thanks") - - self.chat_type = config.get("chat_type") - - self.need_lang = config.get("need_lang") - - self.live2d_config = config.get("live2d") - - # openai - self.openai_config = config.get("openai") - # chatgpt - self.chatgpt_config = config.get("chatgpt") - # claude - self.claude_config = config.get("claude") - # claude2 - self.claude2_config = config.get("claude2") - # chatterbot - self.chatterbot_config = config.get("chatterbot") - # chat_with_file - self.chat_with_file_config = config.get("chat_with_file") - # chatglm - self.chatglm_config = config.get("chatglm") - # text_generation_webui - self.text_generation_webui_config = config.get("text_generation_webui") - # sparkdesk - self.sparkdesk_config = config.get("sparkdesk") - # 智谱AI - self.zhipu_config = config.get("zhipu") - - # 音频合成使用技术 - self.audio_synthesis_type = config.get("audio_synthesis_type") - - self.edge_tts_config = config.get("edge-tts") - self.vits_fast_config = config.get("vits_fast") - self.elevenlabs_config = config.get("elevenlabs") - self.genshinvoice_top_config = config.get("genshinvoice_top") - self.bark_gui_config = config.get("bark_gui") - - # 点歌模式 - self.choose_song_config = config.get("choose_song") - - self.so_vits_svc_config = config.get("so_vits_svc") - - # SD - self.sd_config = config.get("sd") - - # 文案 - self.copywriting_config = config.get("copywriting") - - self.header_config = config.get("header") - - # 聊天 - self.talk_config = config.get("talk") - - """ - 配置Label提示 - """ - # 设置鼠标悬停时的提示文本 - self.ui.label_platform.setToolTip("运行的平台版本") - self.ui.label_room_display_id.setToolTip("待监听的直播间的房间号(直播间URL最后一个/后的数字和字母),需要是开播状态") - self.ui.label_chat_type.setToolTip("弹幕对接的聊天类型") - self.ui.label_visual_body.setToolTip("对接的虚拟身体应用,暂时只用于对接xuniren应用,预留给未来其他应用使用") - self.ui.label_need_lang.setToolTip("只回复选中语言的弹幕,其他语言将被过滤") - self.ui.label_before_prompt.setToolTip("提示词前缀,会自带追加在弹幕前,主要用于追加一些特殊的限制") - self.ui.label_after_prompt.setToolTip("提示词后缀,会自带追加在弹幕后,主要用于追加一些特殊的限制") - self.ui.label_comment_log_type.setToolTip("弹幕日志类型,用于记录弹幕触发时记录的内容,默认只记录回答,降低当用户使用弹幕日志显示在直播间时,因为用户的不良弹幕造成直播间被封禁问题") - - # 念用户名 - self.ui.label_read_user_name_enable.setToolTip("是否启用回复用户弹幕时,念用户的昵称,例:回复xxx。你好") - self.ui.label_read_user_name_voice_change.setToolTip("是否启用变声功能,就是说不仅仅进行TTS,还进行变声,这是为了针对特定场景,区分念用户名和正经回复") - self.ui.label_read_user_name_reply_before.setToolTip("在正经回复前的念用户名的文案,目前是本地问答库-文本 触发时使用") - self.ui.label_read_user_name_reply_after.setToolTip("在正经回复后的念用户名的文案,目前是本地问答库-音频 触发时使用") - - self.ui.label_captions_enable.setToolTip("是否启用字幕日志记录,字幕输出内容为当前合成播放的音频的文本") - self.ui.label_captions_file_path.setToolTip("字幕日志存储路径") - - # 本地问答 - self.ui.label_local_qa_text_enable.setToolTip("是否启用本地问答文本匹配,完全命中设定的问题后,自动合成对应的回答") - self.ui.label_local_qa_text_type.setToolTip("本地问答文本匹配算法类型,默认就是json的自定义数据,更高级。\n一问一答就是旧版本的一行问题一行答案这种,适合新手") - self.ui.label_local_qa_text_file_path.setToolTip("本地问答文本数据存储路径") - self.ui.label_local_qa_text_similarity.setToolTip("最低文本匹配相似度,就是说用户发送的内容和本地问答库中设定的内容的最低相似度。\n低了就会被当做一般弹幕处理") - self.ui.label_local_qa_audio_enable.setToolTip("是否启用本地问答音频匹配,部分命中音频文件名后,直接播放对应的音频文件") - self.ui.label_local_qa_audio_file_path.setToolTip("本地问答音频文件存储路径") - self.ui.label_local_qa_audio_similarity.setToolTip("最低音频匹配相似度,就是说用户发送的内容和本地音频库中音频文件名的最低相似度。\n低了就会被当做一般弹幕处理") - - # 过滤 - self.ui.label_filter_before_must_str.setToolTip("弹幕过滤,必须携带的触发前缀字符串(任一)\n例如:配置#,那么就需要发送:#你好") - self.ui.label_filter_after_must_str.setToolTip("弹幕过滤,必须携带的触发后缀字符串(任一)\n例如:配置。那么就需要发送:你好。") - self.ui.label_filter_badwords_path.setToolTip("本地违禁词数据路径(你如果不需要,可以清空文件内容)") - self.ui.label_filter_bad_pinyin_path.setToolTip("本地违禁拼音数据路径(你如果不需要,可以清空文件内容)") - self.ui.label_filter_max_len.setToolTip("最长阅读的英文单词数(空格分隔)") - self.ui.label_filter_max_char_len.setToolTip("最长阅读的字符数,双重过滤,避免溢出") - self.ui.label_filter_comment_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_comment_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - self.ui.label_filter_gift_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_gift_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - self.ui.label_filter_entrance_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_entrance_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - self.ui.label_filter_follow_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_follow_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - self.ui.label_filter_talk_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_talk_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - self.ui.label_filter_schedule_forget_duration.setToolTip("指的是每隔这个间隔时间(秒),就会丢弃这个间隔时间中接收到的数据,\n保留数据在以下配置中可以自定义") - self.ui.label_filter_schedule_forget_reserve_num.setToolTip("保留最新收到的数据的数量") - - # 答谢 - self.ui.label_thanks_entrance_enable.setToolTip("是否启用欢迎用户进入直播间功能") - self.ui.label_thanks_entrance_copy.setToolTip("用户进入直播间的相关文案,请勿动 {username},此字符串用于替换用户名") - self.ui.label_thanks_gift_enable.setToolTip("是否启用感谢用户赠送礼物功能") - self.ui.label_thanks_gift_copy.setToolTip("用户赠送礼物的相关文案,请勿动 {username} 和 {gift_name},此字符串用于替换用户名和礼物名") - self.ui.label_thanks_lowest_price.setToolTip("设置最低答谢礼物的价格(元),低于这个设置的礼物不会触发答谢") - self.ui.label_thanks_follow_enable.setToolTip("是否启用感谢用户关注的功能") - self.ui.label_thanks_follow_copy.setToolTip("用户关注时的相关文案,请勿动 {username},此字符串用于替换用户名") - - self.ui.label_live2d_enable.setToolTip("启动web服务,用于加载本地Live2D模型") - self.ui.label_live2d_port.setToolTip("web服务运行的端口号,默认:12345,范围:0-65535,没事不要乱改就好") - self.ui.label_live2d_name.setToolTip("模型名称,模型存放于Live2D\live2d-model路径下,请注意路径和模型内容是否匹配") - - # 音频随机变速 - self.ui.label_audio_random_speed_normal_enable.setToolTip("是否启用普通音频的随机变速功能") - self.ui.label_audio_random_speed_normal_speed_min.setToolTip("普通音频的随机变速倍率的下限,就是正常语速乘以上下限直接随机出的数的倍率,\n就是变速后的语速,默认语速倍率为1") - self.ui.label_audio_random_speed_normal_speed_max.setToolTip("普通音频的随机变速倍率的上限,就是正常语速乘以上下限直接随机出的数的倍率,\n就是变速后的语速,默认语速倍率为1") - self.ui.label_audio_random_speed_normal_enable.setToolTip("是否启用文案音频的随机变速功能") - self.ui.label_audio_random_speed_normal_speed_min.setToolTip("文案音频的随机变速倍率的下限,就是正常语速乘以上下限直接随机出的数的倍率,\n就是变速后的语速,默认语速倍率为1") - self.ui.label_audio_random_speed_normal_speed_max.setToolTip("文案音频的随机变速倍率的上限,就是正常语速乘以上下限直接随机出的数的倍率,\n就是变速后的语速,默认语速倍率为1") - - self.ui.label_audio_synthesis_type.setToolTip("语音合成的类型") - - self.ui.label_openai_api.setToolTip("API请求地址,支持代理") - self.ui.label_openai_api_key.setToolTip("API KEY,支持代理") - self.ui.label_chatgpt_model.setToolTip("指定要使用的模型,可以去官方API文档查看模型列表") - self.ui.label_chatgpt_temperature.setToolTip("控制生成文本的随机性。较高的温度值会使生成的文本更随机和多样化,而较低的温度值会使生成的文本更加确定和一致。") - self.ui.label_chatgpt_max_tokens.setToolTip("限制生成回答的最大长度。") - self.ui.label_chatgpt_top_p.setToolTip("也被称为 Nucleus采样。这个参数控制模型从累积概率大于一定阈值的令牌中进行采样。较高的值会产生更多的多样性,较低的值会产生更少但更确定的回答。") - self.ui.label_chatgpt_presence_penalty.setToolTip("控制模型生成回答时对给定问题提示的关注程度。较高的存在惩罚值会减少模型对给定提示的重复程度,鼓励模型更自主地生成回答。") - self.ui.label_chatgpt_frequency_penalty.setToolTip("控制生成回答时对已经出现过的令牌的惩罚程度。较高的频率惩罚值会减少模型生成已经频繁出现的令牌,以避免重复和过度使用特定词语。") - self.ui.label_chatgpt_preset.setToolTip("用于指定一组预定义的设置,以便模型更好地适应特定的对话场景。") - - self.ui.label_claude_slack_user_token.setToolTip("Slack平台配置的用户Token,参考文档的Claude板块进行配置") - self.ui.label_claude_bot_user_id.setToolTip("Slack平台添加的Claude显示的成员ID,参考文档的Claude板块进行配置") - - self.ui.label_claude2_cookie.setToolTip("claude.ai官网,打开F12,随便提问抓个包,请求头cookie配置于此") - self.ui.label_claude2_use_proxy.setToolTip("是否启用代理发送请求") - self.ui.label_claude2_proxies_http.setToolTip("http代理地址,默认为 http://127.0.0.1:10809") - self.ui.label_claude2_proxies_https.setToolTip("https代理地址,默认为 http://127.0.0.1:10809") - self.ui.label_claude2_proxies_socks5.setToolTip("socks5代理地址,默认为 socks://127.0.0.1:10808") - - # chatglm - self.ui.label_chatglm_api_ip_port.setToolTip("ChatGLM的API版本运行后的服务链接(需要完整的URL)") - self.ui.label_chatglm_max_length.setToolTip("生成回答的最大长度限制,以令牌数或字符数为单位。") - self.ui.label_chatglm_top_p.setToolTip("也称为 Nucleus采样。控制模型生成时选择概率的阈值范围。") - self.ui.label_chatglm_temperature.setToolTip("温度参数,控制生成文本的随机性。较高的温度值会产生更多的随机性和多样性。") - self.ui.label_chatglm_history_enable.setToolTip("是否启用上下文历史记忆,让chatglm可以记得前面的内容") - self.ui.label_chatglm_history_max_len.setToolTip("最大记忆的上下文字符数量,不建议设置过大,容易爆显存,自行根据情况配置") - - # langchain_chatglm - self.ui.label_langchain_chatglm_api_ip_port.setToolTip("langchain_chatglm的API版本运行后的服务链接(需要完整的URL)") - self.ui.label_langchain_chatglm_chat_type.setToolTip("选择的聊天类型:模型/知识库/必应") - self.ui.label_langchain_chatglm_knowledge_base_id.setToolTip("本地存在的知识库名称,日志也有输出知识库列表,可以查看") - self.ui.label_langchain_chatglm_history_enable.setToolTip("是否启用上下文历史记忆,让langchain_chatglm可以记得前面的内容") - self.ui.label_langchain_chatglm_history_max_len.setToolTip("最大记忆的上下文字符数量,不建议设置过大,容易爆显存,自行根据情况配置") - - # 讯飞星火 - self.ui.label_sparkdesk_type.setToolTip("选择使用的类型,web抓包 或者 官方API") - self.ui.label_sparkdesk_cookie.setToolTip("web抓包请求头中的cookie,参考文档教程") - self.ui.label_sparkdesk_fd.setToolTip("web抓包负载中的fd,参考文档教程") - self.ui.label_sparkdesk_GtToken.setToolTip("web抓包负载中的GtToken,参考文档教程") - self.ui.label_sparkdesk_app_id.setToolTip("申请官方API后,云平台中提供的APPID") - self.ui.label_sparkdesk_api_secret.setToolTip("申请官方API后,云平台中提供的APISecret") - self.ui.label_sparkdesk_api_key.setToolTip("申请官方API后,云平台中提供的APIKey") - self.ui.label_sparkdesk_version.setToolTip("此处选择模型版本号") - - self.ui.label_chat_with_file_chat_mode.setToolTip("本地向量数据库模式") - self.ui.label_chat_with_file_data_path.setToolTip("加载的本地zip数据文件路径(到x.zip), 如:./data/伊卡洛斯百度百科.zip") - self.ui.label_chat_with_file_separator.setToolTip("拆分文本的分隔符,这里使用 换行符 作为分隔符。") - self.ui.label_chat_with_file_chunk_size.setToolTip("每个文本块的最大字符数(文本块字符越多,消耗token越多,回复越详细)") - self.ui.label_chat_with_file_chunk_overlap.setToolTip("两个相邻文本块之间的重叠字符数。这种重叠可以帮助保持文本的连贯性,特别是当文本被用于训练语言模型或其他需要上下文信息的机器学习模型时") - self.ui.label_chat_with_file_local_vector_embedding_model.setToolTip("指定要使用的OpenAI模型名称") - self.ui.label_chat_with_file_chain_type.setToolTip("指定要生成的语言链的类型,例如:stuff") - self.ui.label_chat_with_file_show_token_cost.setToolTip("表示是否显示生成文本的成本。如果启用,将在终端中显示成本信息。") - self.ui.label_chat_with_file_question_prompt.setToolTip("通过LLM总结本地向量数据库输出内容,此处填写总结用提示词") - self.ui.label_chat_with_file_local_max_query.setToolTip("最大查询数据库次数。限制次数有助于节省token") - - self.ui.label_text_generation_webui_api_ip_port.setToolTip("text-generation-webui开启API模式后监听的IP和端口地址") - self.ui.label_text_generation_webui_max_new_tokens.setToolTip("自行查阅") - self.ui.label_text_generation_webui_mode.setToolTip("自行查阅") - self.ui.label_text_generation_webui_character.setToolTip("自行查阅") - self.ui.label_text_generation_webui_instruction_template.setToolTip("自行查阅") - self.ui.label_text_generation_webui_your_name.setToolTip("自行查阅") - - self.ui.label_chatterbot_name.setToolTip("机器人名称") - self.ui.label_chatterbot_db_path.setToolTip("数据库路径") - - self.ui.label_edge_tts_voice.setToolTip("选定的说话人(cmd执行:edge-tts -l 可以查看所有支持的说话人)") - self.ui.label_edge_tts_rate.setToolTip("语速增益 默认是 +0%,可以增减,注意 + - %符合别搞没了,不然会影响语音合成") - self.ui.label_edge_tts_volume.setToolTip("音量增益 默认是 +0%,可以增减,注意 + - %符合别搞没了,不然会影响语音合成") - - # vits_fast - self.ui.label_vits_fast_config_path.setToolTip("配置文件的路径,例如:E:\\inference\\finetune_speaker.json") - self.ui.label_vits_fast_api_ip_port.setToolTip("推理服务运行的链接(需要完整的URL)") - self.ui.label_vits_fast_character.setToolTip("选择的说话人,配置文件中的speaker中的其中一个") - self.ui.label_vits_fast_language.setToolTip("选择的合成文本的语言,建议和模型语言匹配,效果最佳") - self.ui.label_vits_fast_speed.setToolTip("语速,默认为1") - - self.ui.label_elevenlabs_api_key.setToolTip("elevenlabs密钥,可以不填,默认也有一定额度的免费使用权限,具体多少不知道") - self.ui.label_elevenlabs_voice.setToolTip("选择的说话人名") - self.ui.label_elevenlabs_model.setToolTip("选择的模型") - - self.ui.label_genshinvoice_top_speaker.setToolTip("生成对应角色的语音") - self.ui.label_genshinvoice_top_noise.setToolTip("控制感情变化程度,默认为0.2") - self.ui.label_genshinvoice_top_noisew.setToolTip("控制音节发音长度变化程度,默认为0.9") - self.ui.label_genshinvoice_top_length.setToolTip("可用于控制整体语速。默认为1.2") - self.ui.label_genshinvoice_top_format.setToolTip("原有接口以WAV格式合成语音,在MP3格式合成语音的情况下,涉及到音频格式转换合成速度会变慢,建议选择WAV格式") - self.ui.label_genshinvoice_top_language.setToolTip("合成文本对应的语言") - - # bark-gui - self.ui.label_bark_gui_api_ip_port.setToolTip("bark-gui开启webui后监听的IP和端口地址") - self.ui.label_bark_gui_spk.setToolTip("选择的说话人,webui的voice中对应的说话人") - self.ui.label_bark_gui_generation_temperature.setToolTip("控制合成过程中生成语音的随机性。较高的值(接近1.0)会使输出更加随机,而较低的值(接近0.0)则使其更加确定性和集中。") - self.ui.label_bark_gui_waveform_temperature.setToolTip("类似于generation_temperature,但该参数专门控制从语音模型生成的波形的随机性") - self.ui.label_bark_gui_end_of_sentence_probability.setToolTip("该参数确定在句子结尾添加停顿或间隔的可能性。较高的值会增加停顿的几率,而较低的值则会减少。") - self.ui.label_bark_gui_quick_generation.setToolTip("如果启用,可能会启用一些优化或在合成过程中采用更快的方式来生成语音。然而,这可能会影响语音的质量。") - self.ui.label_bark_gui_seed.setToolTip("用于随机数生成器的种子值。使用特定的种子确保相同的输入文本每次生成的语音输出都是相同的。值为-1表示将使用随机种子。") - self.ui.label_bark_gui_batch_count.setToolTip("指定一次批量合成的句子或话语数量。将其设置为1意味着逐句合成一次。") - - # 点歌 - self.ui.label_choose_song_enable.setToolTip("是否启用点歌模式") - self.ui.label_choose_song_start_cmd.setToolTip("点歌触发命令(完全匹配才行)") - self.ui.label_choose_song_stop_cmd.setToolTip("停止点歌命令(完全匹配才行)") - self.ui.label_choose_song_random_cmd.setToolTip("随机点歌命令(完全匹配才行)") - self.ui.label_choose_song_song_path.setToolTip("歌曲音频路径(默认为本项目的song文件夹)") - self.ui.label_choose_song_match_fail_copy.setToolTip("匹配失败返回的音频文案 注意 {content} 这个是用于替换用户发送的歌名的,请务必不要乱删!影响使用!") - - # DDSP-SVC - self.ui.label_ddsp_svc_enable.setToolTip("是否启用DDSP-SVC进行音频的变声") - self.ui.label_ddsp_svc_config_path.setToolTip("模型配置文件config.yaml的路径(此处可以不配置,暂时没有用到)") - self.ui.label_ddsp_svc_api_ip_port.setToolTip("flask_api服务运行的ip端口,例如:http://127.0.0.1:6844") - self.ui.label_ddsp_svc_fSafePrefixPadLength.setToolTip("安全前缀填充长度,不知道干啥用,默认为0") - self.ui.label_ddsp_svc_fPitchChange.setToolTip("音调设置,默认为0") - self.ui.label_ddsp_svc_sSpeakId.setToolTip("说话人ID,需要和模型数据对应,默认为0") - self.ui.label_ddsp_svc_sampleRate.setToolTip("DAW所需的采样率,默认为44100") - - # so-vits-svc - self.ui.label_so_vits_svc_enable.setToolTip("是否启用so-vits-svc进行音频的变声") - self.ui.label_so_vits_svc_config_path.setToolTip("模型配置文件config.json的路径") - self.ui.label_so_vits_svc_api_ip_port.setToolTip("flask_api_full_song服务运行的ip端口,例如:http://127.0.0.1:1145") - self.ui.label_so_vits_svc_spk.setToolTip("说话人,需要和配置文件内容对应") - self.ui.label_so_vits_svc_tran.setToolTip("音调设置,默认为1") - self.ui.label_so_vits_svc_wav_format.setToolTip("音频合成后输出的格式") - - # SD - self.ui.label_sd_enable.setToolTip("是否启用SD来进行画图") - self.ui.label_prompt_llm_type.setToolTip("选择LLM来对提示词进行优化") - self.ui.label_prompt_llm_before_prompt.setToolTip("LLM提示词前缀") - self.ui.label_prompt_llm_after_prompt.setToolTip("LLM提示词后缀") - self.ui.label_sd_trigger.setToolTip("触发的关键词(弹幕头部触发)") - self.ui.label_sd_ip.setToolTip("服务运行的IP地址") - self.ui.label_sd_port.setToolTip("服务运行的端口") - self.ui.label_sd_negative_prompt.setToolTip("负面文本提示,用于指定与生成图像相矛盾或相反的内容") - self.ui.label_sd_seed.setToolTip("随机种子,用于控制生成过程的随机性。可以设置一个整数值,以获得可重复的结果。") - self.ui.label_sd_styles.setToolTip("样式列表,用于指定生成图像的风格。可以包含多个风格,例如 [\"anime\", \"portrait\"]") - self.ui.label_sd_cfg_scale.setToolTip("提示词相关性,无分类器指导信息影响尺度(Classifier Free Guidance Scale) -图像应在多大程度上服从提示词-较低的值会产生更有创意的结果。") - self.ui.label_sd_steps.setToolTip("生成图像的步数,用于控制生成的精确程度。") - self.ui.label_sd_enable_hr.setToolTip("是否启用高分辨率生成。默认为 False。") - self.ui.label_sd_hr_scale.setToolTip("高分辨率缩放因子,用于指定生成图像的高分辨率缩放级别。") - self.ui.label_sd_hr_second_pass_steps.setToolTip("高分辨率生成的第二次传递步数。") - self.ui.label_sd_hr_resize_x.setToolTip("生成图像的水平尺寸。") - self.ui.label_sd_hr_resize_y.setToolTip("生成图像的垂直尺寸。") - self.ui.label_sd_denoising_strength.setToolTip("去噪强度,用于控制生成图像中的噪点。") - - self.ui.label_header_useragent.setToolTip("请求头,暂时没有用到,备用") - - # 文案 - self.ui.label_copywriting_config_index.setToolTip("文案编号索引,用于对指定编号进行增加删除操作") - self.ui.pushButton_copywriting_config_index_add.setToolTip("对指定编号文案进行增加操作") - self.ui.pushButton_copywriting_config_index_del.setToolTip("对指定编号文案进行删除操作") - self.ui.label_copywriting_audio_interval.setToolTip("文案音频播放之间的间隔时间。就是前一个文案播放完成后,到后一个文案开始播放之间的间隔时间。") - self.ui.label_copywriting_switching_interval.setToolTip("文案音频切换到弹幕音频的切换间隔时间(反之一样)。\n就是在播放文案时,有弹幕触发并合成完毕,此时会暂停文案播放,然后等待这个间隔时间后,再播放弹幕回复音频。") - self.ui.label_copywriting_switching_auto_play.setToolTip("文案自动播放,就是说启用后,会自动播放,不需要手动点播放了") - self.ui.label_copywriting_switching_random_play.setToolTip("文案随机播放,就是不根据播放音频文件列表的顺序播放,而是随机打乱顺序进行播放。") - self.ui.label_copywriting_select.setToolTip("输入要加载的文案文件全名,文件全名从文案列表中复制。如果文件不存在,则会自动创建") - self.ui.pushButton_copywriting_select.setToolTip("加载 左侧输入框中的文件相对/绝对路径的文件内容,输出到下方编辑框内。如果文件不存在,则会自动创建") - self.ui.pushButton_copywriting_refresh_list.setToolTip("刷新 文案列表、音频列表中的内容,用于加载新数据") - self.ui.label_copywriting_edit.setToolTip("此处由上方 选择的文案通过加载读取文件内容,在此可以修改文案内容,方便重新合成") - self.ui.pushButton_copywriting_save.setToolTip("保存上方 文案编辑框中的内容到文案文件中") - self.ui.pushButton_copywriting_synthetic_audio.setToolTip("读取当前选择的文案文件内容,通过配置的 语音合成模式来进行合成,和弹幕合成机制类似。\n需要注意,合成前记得保存文案,合成文案较多时,请耐心等待。建议:自行手动合成文案音频,放到文案音频目录中,这里合成感觉不太行") - self.ui.pushButton_copywriting_loop_play.setToolTip("循环播放 播放列表中配置的音频文件(记得保存配置)。") - self.ui.pushButton_copywriting_pause_play.setToolTip("暂停当前播放的音频") - - # 聊天 - self.ui.label_talk_username.setToolTip("日志中你的名字,暂时没有实质作用") - self.ui.label_talk_continuous_talk.setToolTip("是否开启连续对话模式,点击触发按键后可以持续进行录音,点击停录按键停止录音") - self.ui.label_talk_trigger_key.setToolTip("录音触发按键(单击此按键进行录音)") - self.ui.label_talk_stop_trigger_key.setToolTip("停止录音按键(单击此按键停止下一次录音)") - self.ui.label_talk_type.setToolTip("选择的语音识别类型") - self.ui.label_talk_volume_threshold.setToolTip("音量阈值,指的是触发录音的起始音量值,请根据自己的麦克风进行微调到最佳") - self.ui.label_talk_silence_threshold.setToolTip("沉默阈值,指的是触发停止路径的最低音量值,请根据自己的麦克风进行微调到最佳") - self.ui.label_talk_baidu_app_id.setToolTip("百度云 语音识别应用的 AppID") - self.ui.label_talk_baidu_api_key.setToolTip("百度云 语音识别应用的 API Key") - self.ui.label_talk_baidu_secret_key.setToolTip("百度云 语音识别应用的 Secret Key") - self.ui.label_talk_google_tgt_lang.setToolTip("录音后识别转换成的目标语言(就是你说的语言)") - self.ui.label_talk_chat_box.setToolTip("此处填写对话内容可以直接进行对话(前面配置好聊天模式,记得运行先)") - self.ui.pushButton_talk_chat_box_send.setToolTip("点击发送聊天框内的内容") - self.ui.pushButton_talk_chat_box_reread.setToolTip("点击发送聊天框内的内容,直接让程序通过配置的TTS和变声进行复读") - - # 动态文案 - self.ui.label_trends_copywriting_enable.setToolTip("是否启用动态文案功能") - self.ui.label_trends_copywriting_random_play.setToolTip("是否启用随机播放功能") - self.ui.label_trends_copywriting_play_interval.setToolTip("文案于文案之间的播放间隔时间(秒)") - - # 按键映射 - self.ui.label_key_mapping_enable.setToolTip("是否启用按键映射功能") - self.ui.label_key_mapping_type.setToolTip("触发按键映射功能的板块类型") - self.ui.label_key_mapping_start_cmd.setToolTip("按键映射命令的命令起始,默认为:按键 ,如果弹幕不是这个命令打头,则不会触发") - - # 积分页 - self.ui.label_integral_common_enable.setToolTip("是否启用积分机制") - - """ - 配置同步UI - """ - # 修改下拉框内容 - self.ui.comboBox_platform.clear() - self.ui.comboBox_platform.addItems(["聊天模式", "哔哩哔哩", "抖音", "快手", "斗鱼", "YouTube", "twitch", "哔哩哔哩2"]) - platform_index = 0 - if self.platform == "talk": - platform_index = 0 - elif self.platform == "bilibili": - platform_index = 1 - elif self.platform == "dy": - platform_index = 2 - elif self.platform == "ks": - platform_index = 3 - elif self.platform == "douyu": - platform_index = 4 - elif self.platform == "youtube": - platform_index = 5 - elif self.platform == "twitch": - platform_index = 6 - elif self.platform == "bilibili2": - platform_index = 7 - self.ui.comboBox_platform.setCurrentIndex(platform_index) - - # 修改输入框内容 - self.ui.lineEdit_room_display_id.setText(self.room_id) - - # 新增LLM时,需要为这块的下拉菜单追加配置项 - self.ui.comboBox_chat_type.clear() - self.ui.comboBox_chat_type.addItems([ - "不启用", - "复读机", - "ChatGPT/闻达", - "Claude", - "Claude2", - "ChatGLM", - "chat_with_file", - "Chatterbot", - "text_generation_webui", - "讯飞星火", - "langchain_chatglm", - "智谱AI", - "Bard", - "文心一言", - "通义千问" - ]) - chat_type_index = 0 - if self.chat_type == "none": - chat_type_index = 0 - elif self.chat_type == "reread": - chat_type_index = 1 - elif self.chat_type == "chatgpt": - chat_type_index = 2 - elif self.chat_type == "claude": - chat_type_index = 3 - elif self.chat_type == "claude2": - chat_type_index = 4 - elif self.chat_type == "chatglm": - chat_type_index = 5 - elif self.chat_type == "chat_with_file": - chat_type_index = 6 - elif self.chat_type == "chatterbot": - chat_type_index = 7 - elif self.chat_type == "text_generation_webui": - chat_type_index = 8 - elif self.chat_type == "sparkdesk": - chat_type_index = 9 - elif self.chat_type == "langchain_chatglm": - chat_type_index = 10 - elif self.chat_type == "zhipu": - chat_type_index = 11 - elif self.chat_type == "bard": - chat_type_index = 12 - elif self.chat_type == "yiyan": - chat_type_index = 13 - elif self.chat_type == "tongyi": - chat_type_index = 14 - self.ui.comboBox_chat_type.setCurrentIndex(chat_type_index) - - # 虚拟身体 - self.ui.comboBox_visual_body.clear() - self.ui.comboBox_visual_body.addItems(["其他", "xuniren", "unity"]) - visual_body_index = 0 - if config.get("visual_body") == "其他": - visual_body_index = 0 - elif config.get("visual_body") == "xuniren": - visual_body_index = 1 - elif config.get("visual_body") == "unity": - visual_body_index = 2 - self.ui.comboBox_visual_body.setCurrentIndex(visual_body_index) - - self.ui.comboBox_need_lang.clear() - self.ui.comboBox_need_lang.addItems(["所有", "中文", "英文", "日文"]) - need_lang_index = 0 - if self.need_lang == "none": - need_lang_index = 0 - elif self.need_lang == "zh": - need_lang_index = 1 - elif self.need_lang == "en": - need_lang_index = 2 - elif self.need_lang == "jp": - need_lang_index = 3 - self.ui.comboBox_need_lang.setCurrentIndex(need_lang_index) - - self.ui.lineEdit_before_prompt.setText(self.before_prompt) - self.ui.lineEdit_after_prompt.setText(self.after_prompt) - - # 本地问答 - if config.get("read_user_name", "enable"): - self.ui.checkBox_read_user_name_enable.setChecked(True) - if config.get("read_user_name", "voice_change"): - self.ui.checkBox_read_user_name_voice_change.setChecked(True) - tmp_str = "" - for tmp in config.get("read_user_name", "reply_before"): - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_read_user_name_reply_before.setText(tmp_str) - tmp_str = "" - for tmp in config.get("read_user_name", "reply_after"): - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_read_user_name_reply_after.setText(tmp_str) - - self.ui.comboBox_comment_log_type.clear() - comment_log_types = ["问答", "问题", "回答", "不记录"] - self.ui.comboBox_comment_log_type.addItems(comment_log_types) - comment_log_type_index = comment_log_types.index(self.comment_log_type) - self.ui.comboBox_comment_log_type.setCurrentIndex(comment_log_type_index) - - - # 日志 - if self.captions_config['enable']: - self.ui.checkBox_captions_enable.setChecked(True) - self.ui.lineEdit_captions_file_path.setText(self.captions_config['file_path']) - - # 本地问答 - if self.local_qa_config['text']['enable']: - self.ui.checkBox_local_qa_text_enable.setChecked(True) - self.ui.comboBox_local_qa_text_type.clear() - local_qa_text_types = ["自定义json", "一问一答"] - self.ui.comboBox_local_qa_text_type.addItems(local_qa_text_types) - if self.local_qa_config['text']['type'] == "text": - self.ui.comboBox_local_qa_text_type.setCurrentIndex(1) - else: - self.ui.comboBox_local_qa_text_type.setCurrentIndex(0) - self.ui.lineEdit_local_qa_text_file_path.setText(self.local_qa_config['text']['file_path']) - self.ui.lineEdit_local_qa_text_similarity.setText(str(self.local_qa_config['text']['similarity'])) - if self.local_qa_config['audio']['enable']: - self.ui.checkBox_local_qa_audio_enable.setChecked(True) - self.ui.lineEdit_local_qa_audio_file_path.setText(self.local_qa_config['audio']['file_path']) - self.ui.lineEdit_local_qa_audio_similarity.setText(str(self.local_qa_config['audio']['similarity'])) - - # 过滤 - tmp_str = "" - for tmp in self.filter_config['before_must_str']: - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_filter_before_must_str.setText(tmp_str) - tmp_str = "" - for tmp in self.filter_config['after_must_str']: - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_filter_after_must_str.setText(tmp_str) - self.ui.lineEdit_filter_badwords_path.setText(self.filter_config['badwords_path']) - self.ui.lineEdit_filter_bad_pinyin_path.setText(self.filter_config['bad_pinyin_path']) - self.ui.lineEdit_filter_max_len.setText(str(self.filter_config['max_len'])) - self.ui.lineEdit_filter_max_char_len.setText(str(self.filter_config['max_char_len'])) - self.ui.lineEdit_filter_comment_forget_duration.setText(str(self.filter_config['comment_forget_duration'])) - self.ui.lineEdit_filter_comment_forget_reserve_num.setText(str(self.filter_config['comment_forget_reserve_num'])) - self.ui.lineEdit_filter_gift_forget_duration.setText(str(self.filter_config['gift_forget_duration'])) - self.ui.lineEdit_filter_gift_forget_reserve_num.setText(str(self.filter_config['gift_forget_reserve_num'])) - self.ui.lineEdit_filter_entrance_forget_duration.setText(str(self.filter_config['entrance_forget_duration'])) - self.ui.lineEdit_filter_entrance_forget_reserve_num.setText(str(self.filter_config['entrance_forget_reserve_num'])) - self.ui.lineEdit_filter_follow_forget_duration.setText(str(self.filter_config['follow_forget_duration'])) - self.ui.lineEdit_filter_follow_forget_reserve_num.setText(str(self.filter_config['follow_forget_reserve_num'])) - self.ui.lineEdit_filter_talk_forget_duration.setText(str(self.filter_config['talk_forget_duration'])) - self.ui.lineEdit_filter_talk_forget_reserve_num.setText(str(self.filter_config['talk_forget_reserve_num'])) - self.ui.lineEdit_filter_schedule_forget_duration.setText(str(self.filter_config['schedule_forget_duration'])) - self.ui.lineEdit_filter_schedule_forget_reserve_num.setText(str(self.filter_config['schedule_forget_reserve_num'])) - - - # 答谢 - if self.thanks_config['entrance_enable']: - self.ui.checkBox_thanks_entrance_enable.setChecked(True) - self.ui.lineEdit_thanks_entrance_copy.setText(self.thanks_config['entrance_copy']) - if self.thanks_config['gift_enable']: - self.ui.checkBox_thanks_gift_enable.setChecked(True) - self.ui.lineEdit_thanks_gift_copy.setText(self.thanks_config['gift_copy']) - self.ui.lineEdit_thanks_lowest_price.setText(str(self.thanks_config['lowest_price'])) - if self.thanks_config['follow_enable']: - self.ui.checkBox_thanks_follow_enable.setChecked(True) - self.ui.lineEdit_thanks_follow_copy.setText(self.thanks_config['follow_copy']) - - if self.live2d_config['enable']: - self.ui.checkBox_live2d_enable.setChecked(True) - self.ui.lineEdit_live2d_port.setText(str(self.live2d_config['port'])) - self.ui.comboBox_live2d_name.clear() - live2d_names = common.get_folder_names("Live2D/live2d-model") # 路径写死 - logging.info(f"本地Live2D模型名列表:{live2d_names}") - self.ui.comboBox_live2d_name.addItems(live2d_names) - live2d_model_name = common.get_live2d_model_name("Live2D/js/model_name.js") # 路径写死 - live2d_name_index = live2d_names.index(live2d_model_name) - self.ui.comboBox_live2d_name.setCurrentIndex(live2d_name_index) - self.ui.comboBox_live2d_name.setEditable(True) - self.ui.comboBox_live2d_name.original_items = live2d_names - self.ui.comboBox_live2d_name.lineEdit().textChanged.connect(lambda text, combo=self.ui.comboBox_live2d_name: self.filter_combobox(combo, text, manual_clear=True)) - - - # 音频随机变速 - if config.get("audio_random_speed", "normal", "enable"): - self.ui.checkBox_audio_random_speed_normal_enable.setChecked(True) - self.ui.lineEdit_audio_random_speed_normal_speed_min.setText(str(config.get("audio_random_speed", "normal", "speed_min"))) - self.ui.lineEdit_audio_random_speed_normal_speed_max.setText(str(config.get("audio_random_speed", "normal", "speed_max"))) - if config.get("audio_random_speed", "copywriting", "enable"): - self.ui.checkBox_audio_random_speed_copywriting_enable.setChecked(True) - self.ui.lineEdit_audio_random_speed_copywriting_speed_min.setText(str(config.get("audio_random_speed", "copywriting", "speed_min"))) - self.ui.lineEdit_audio_random_speed_copywriting_speed_max.setText(str(config.get("audio_random_speed", "copywriting", "speed_max"))) - - self.ui.lineEdit_header_useragent.setText(self.header_config['userAgent']) - - self.ui.lineEdit_openai_api.setText(self.openai_config['api']) - tmp_str = "" - for tmp in self.openai_config['api_key']: - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_openai_api_key.setText(tmp_str) - - self.ui.comboBox_chatgpt_model.clear() - chatgpt_models = ["gpt-3.5-turbo", - "gpt-3.5-turbo-0301", - "gpt-3.5-turbo-0613", - "gpt-3.5-turbo-16k", - "gpt-3.5-turbo-16k-0613", - "gpt-4", - "gpt-4-0314", - "gpt-4-0613", - "gpt-4-32k", - "gpt-4-32k-0314", - "gpt-4-32k-0613", - "gpt-4-1106-preview", - "text-embedding-ada-002", - "text-davinci-003", - "text-davinci-002", - "text-curie-001", - "text-babbage-001", - "text-ada-001", - "text-moderation-latest", - "text-moderation-stable", - "rwkv", - "chatglm3-6b"] - self.ui.comboBox_chatgpt_model.addItems(chatgpt_models) - chatgpt_model_index = chatgpt_models.index(self.chatgpt_config['model']) - self.ui.comboBox_chatgpt_model.setCurrentIndex(chatgpt_model_index) - self.ui.lineEdit_chatgpt_temperature.setText(str(self.chatgpt_config['temperature'])) - self.ui.lineEdit_chatgpt_max_tokens.setText(str(self.chatgpt_config['max_tokens'])) - self.ui.lineEdit_chatgpt_top_p.setText(str(self.chatgpt_config['top_p'])) - self.ui.lineEdit_chatgpt_presence_penalty.setText(str(self.chatgpt_config['presence_penalty'])) - self.ui.lineEdit_chatgpt_frequency_penalty.setText(str(self.chatgpt_config['frequency_penalty'])) - self.ui.lineEdit_chatgpt_preset.setText(self.chatgpt_config['preset']) - - self.ui.lineEdit_claude_slack_user_token.setText(self.claude_config['slack_user_token']) - self.ui.lineEdit_claude_bot_user_id.setText(self.claude_config['bot_user_id']) - - self.ui.lineEdit_claude2_cookie.setText(self.claude2_config['cookie']) - if self.claude2_config['use_proxy']: - self.ui.checkBox_claude2_use_proxy.setChecked(True) - self.ui.lineEdit_claude2_proxies_http.setText(self.claude2_config['proxies']['http']) - self.ui.lineEdit_claude2_proxies_https.setText(self.claude2_config['proxies']['https']) - self.ui.lineEdit_claude2_proxies_socks5.setText(self.claude2_config['proxies']['socks5']) - - # chatglm - self.ui.lineEdit_chatglm_api_ip_port.setText(self.chatglm_config['api_ip_port']) - self.ui.lineEdit_chatglm_max_length.setText(str(self.chatglm_config['max_length'])) - self.ui.lineEdit_chatglm_top_p.setText(str(self.chatglm_config['top_p'])) - self.ui.lineEdit_chatglm_temperature.setText(str(self.chatglm_config['temperature'])) - if self.chatglm_config['history_enable']: - self.ui.checkBox_chatglm_history_enable.setChecked(True) - self.ui.lineEdit_chatglm_history_max_len.setText(str(self.chatglm_config['history_max_len'])) - - # langchain_chatglm - self.ui.lineEdit_langchain_chatglm_api_ip_port.setText(config.get("langchain_chatglm", "api_ip_port")) - self.ui.comboBox_langchain_chatglm_chat_type.clear() - self.ui.comboBox_langchain_chatglm_chat_type.addItems(["模型", "知识库", "必应"]) - langchain_chatglm_chat_type_index = 0 - if config.get("langchain_chatglm", "chat_type") == "模型": - langchain_chatglm_chat_type_index = 0 - elif config.get("langchain_chatglm", "chat_type") == "知识库": - langchain_chatglm_chat_type_index = 1 - elif config.get("langchain_chatglm", "chat_type") == "必应": - langchain_chatglm_chat_type_index = 2 - self.ui.comboBox_langchain_chatglm_chat_type.setCurrentIndex(langchain_chatglm_chat_type_index) - self.ui.lineEdit_langchain_chatglm_knowledge_base_id.setText(config.get("langchain_chatglm", "knowledge_base_id")) - if config.get("langchain_chatglm", "history_enable"): - self.ui.checkBox_langchain_chatglm_history_enable.setChecked(True) - self.ui.lineEdit_langchain_chatglm_history_max_len.setText(str(config.get("langchain_chatglm", "history_max_len"))) - - self.ui.comboBox_chat_with_file_chat_mode.clear() - self.ui.comboBox_chat_with_file_chat_mode.addItems(["claude", "openai_gpt", "openai_vector_search"]) - chat_with_file_chat_mode_index = 0 - if self.chat_with_file_config['chat_mode'] == "claude": - chat_with_file_chat_mode_index = 0 - elif self.chat_with_file_config['chat_mode'] == "openai_gpt": - chat_with_file_chat_mode_index = 1 - elif self.chat_with_file_config['chat_mode'] == "openai_vector_search": - chat_with_file_chat_mode_index = 2 - self.ui.comboBox_chat_with_file_chat_mode.setCurrentIndex(chat_with_file_chat_mode_index) - self.ui.comboBox_chat_with_file_local_vector_embedding_model.clear() - self.ui.comboBox_chat_with_file_local_vector_embedding_model.addItems(["sebastian-hofstaetter/distilbert-dot-tas_b-b256-msmarco", "GanymedeNil/text2vec-large-chinese"]) - chat_with_file_local_vector_embedding_model_index = 0 - if self.chat_with_file_config['local_vector_embedding_model'] == "sebastian-hofstaetter/distilbert-dot-tas_b-b256-msmarco": - chat_with_file_local_vector_embedding_model_index = 0 - elif self.chat_with_file_config['local_vector_embedding_model'] == "GanymedeNil/text2vec-large-chinese": - chat_with_file_local_vector_embedding_model_index = 1 - self.ui.comboBox_chat_with_file_local_vector_embedding_model.setCurrentIndex(chat_with_file_local_vector_embedding_model_index) - self.ui.lineEdit_chat_with_file_data_path.setText(self.chat_with_file_config['data_path']) - self.ui.lineEdit_chat_with_file_separator.setText(self.chat_with_file_config['separator']) - self.ui.lineEdit_chat_with_file_chunk_size.setText(str(self.chat_with_file_config['chunk_size'])) - self.ui.lineEdit_chat_with_file_chunk_overlap.setText(str(self.chat_with_file_config['chunk_overlap'])) - self.ui.lineEdit_chat_with_file_question_prompt.setText(str(self.chat_with_file_config['question_prompt'])) - self.ui.lineEdit_chat_with_file_local_max_query.setText(str(self.chat_with_file_config['local_max_query'])) - self.ui.lineEdit_chat_with_file_chain_type.setText(self.chat_with_file_config['chain_type']) - if self.chat_with_file_config['show_token_cost']: - self.ui.checkBox_chat_with_file_show_token_cost.setChecked(True) - - self.ui.lineEdit_chatterbot_name.setText(self.chatterbot_config['name']) - self.ui.lineEdit_chatterbot_db_path.setText(self.chatterbot_config['db_path']) - - self.ui.lineEdit_text_generation_webui_api_ip_port.setText(str(self.text_generation_webui_config['api_ip_port'])) - self.ui.lineEdit_text_generation_webui_max_new_tokens.setText(str(self.text_generation_webui_config['max_new_tokens'])) - self.ui.lineEdit_text_generation_webui_mode.setText(str(self.text_generation_webui_config['mode'])) - self.ui.lineEdit_text_generation_webui_character.setText(str(self.text_generation_webui_config['character'])) - self.ui.lineEdit_text_generation_webui_instruction_template.setText(str(self.text_generation_webui_config['instruction_template'])) - self.ui.lineEdit_text_generation_webui_your_name.setText(str(self.text_generation_webui_config['your_name'])) - - # 讯飞星火 - self.ui.comboBox_sparkdesk_type.clear() - self.ui.comboBox_sparkdesk_type.addItems(["web", "api"]) - sparkdesk_type_index = 0 - if self.sparkdesk_config['type'] == "web": - sparkdesk_type_index = 0 - elif self.sparkdesk_config['type'] == "api": - sparkdesk_type_index = 1 - self.ui.comboBox_sparkdesk_type.setCurrentIndex(sparkdesk_type_index) - self.ui.lineEdit_sparkdesk_cookie.setText(self.sparkdesk_config['cookie']) - self.ui.lineEdit_sparkdesk_fd.setText(self.sparkdesk_config['fd']) - self.ui.lineEdit_sparkdesk_GtToken.setText(self.sparkdesk_config['GtToken']) - self.ui.lineEdit_sparkdesk_app_id.setText(self.sparkdesk_config['app_id']) - self.ui.lineEdit_sparkdesk_api_secret.setText(self.sparkdesk_config['api_secret']) - self.ui.lineEdit_sparkdesk_api_key.setText(self.sparkdesk_config['api_key']) - self.ui.comboBox_sparkdesk_version.clear() - self.ui.comboBox_sparkdesk_version.addItems(["3.1", "2.1", "1.1"]) - sparkdesk_version_index = 0 - if self.sparkdesk_config['version'] == 3.1: - sparkdesk_version_index = 0 - elif self.sparkdesk_config['version'] == 2.1: - sparkdesk_version_index = 1 - elif self.sparkdesk_config['version'] == 1.1: - sparkdesk_version_index = 2 - self.ui.comboBox_sparkdesk_version.setCurrentIndex(sparkdesk_version_index) - - self.ui.comboBox_audio_synthesis_type.clear() - self.ui.comboBox_audio_synthesis_type.addItems(["Edge-TTS", "VITS", "VITS-Fast", "elevenlabs", "genshinvoice_top", "bark_gui", "VALL-E-X", "OpenAI TTS"]) - audio_synthesis_type_index = 0 - if self.audio_synthesis_type == "edge-tts": - audio_synthesis_type_index = 0 - elif self.audio_synthesis_type == "vits": - audio_synthesis_type_index = 1 - elif self.audio_synthesis_type == "vits_fast": - audio_synthesis_type_index = 2 - elif self.audio_synthesis_type == "elevenlabs": - audio_synthesis_type_index = 3 - elif self.audio_synthesis_type == "genshinvoice_top": - audio_synthesis_type_index = 4 - elif self.audio_synthesis_type == "bark_gui": - audio_synthesis_type_index = 5 - elif self.audio_synthesis_type == "vall_e_x": - audio_synthesis_type_index = 6 - elif self.audio_synthesis_type == "openai_tts": - audio_synthesis_type_index = 7 - self.ui.comboBox_audio_synthesis_type.setCurrentIndex(audio_synthesis_type_index) - - # vits_fast - self.ui.lineEdit_vits_fast_config_path.setText(self.vits_fast_config['config_path']) - self.ui.lineEdit_vits_fast_api_ip_port.setText(self.vits_fast_config['api_ip_port']) - self.ui.lineEdit_vits_fast_character.setText(self.vits_fast_config['character']) - self.ui.comboBox_vits_fast_language.clear() - self.ui.comboBox_vits_fast_language.addItems(["自动识别", "日本語", "简体中文", "English", "Mix"]) - vits_fast_language_index = 0 - if self.vits_fast_config['language'] == "自动识别": - vits_fast_language_index = 0 - elif self.vits_fast_config['language'] == "日本語": - vits_fast_language_index = 1 - elif self.vits_fast_config['language'] == "简体中文": - vits_fast_language_index = 2 - elif self.vits_fast_config['language'] == "English": - vits_fast_language_index = 3 - elif self.vits_fast_config['language'] == "Mix": - vits_fast_language_index = 4 - self.ui.comboBox_vits_fast_language.setCurrentIndex(vits_fast_language_index) - self.ui.lineEdit_vits_fast_speed.setText(str(self.vits_fast_config['speed'])) - - self.ui.comboBox_edge_tts_voice.clear() - with open('data\edge-tts-voice-list.txt', 'r') as file: - file_content = file.read() - # 按行分割内容,并去除每行末尾的换行符 - lines = file_content.strip().split('\n') - # 存储到字符串数组中 - edge_tts_voices = [line for line in lines] - # print(edge_tts_voices) - self.ui.comboBox_edge_tts_voice.addItems(edge_tts_voices) - edge_tts_voice_index = edge_tts_voices.index(self.edge_tts_config['voice']) - self.ui.comboBox_edge_tts_voice.setCurrentIndex(edge_tts_voice_index) - self.ui.lineEdit_edge_tts_rate.setText(self.edge_tts_config['rate']) - self.ui.lineEdit_edge_tts_volume.setText(self.edge_tts_config['volume']) - - self.ui.lineEdit_elevenlabs_api_key.setText(self.elevenlabs_config['api_key']) - self.ui.lineEdit_elevenlabs_voice.setText(self.elevenlabs_config['voice']) - self.ui.lineEdit_elevenlabs_model.setText(self.elevenlabs_config['model']) - - self.ui.comboBox_genshinvoice_top_speaker.clear() - with open('data\genshinvoice_top_speak_list.txt', 'r', encoding='utf-8') as file: - file_content = file.read() - # 按行分割内容,并去除每行末尾的换行符 - lines = file_content.strip().split('\n') - # 存储到字符串数组中 - genshinvoice_top_speaker = [line for line in lines] - # print(genshinvoice_top_speaker) - self.ui.comboBox_genshinvoice_top_speaker.addItems(genshinvoice_top_speaker) - self.ui.comboBox_genshinvoice_top_speaker.setEditable(True) - self.ui.comboBox_genshinvoice_top_speaker.original_items = genshinvoice_top_speaker - genshinvoice_top_speaker_index = genshinvoice_top_speaker.index(self.genshinvoice_top_config['speaker']) - self.ui.comboBox_genshinvoice_top_speaker.setCurrentIndex(genshinvoice_top_speaker_index) - self.ui.comboBox_genshinvoice_top_speaker.lineEdit().textChanged.connect(lambda text, combo=self.ui.comboBox_genshinvoice_top_speaker: self.filter_combobox(combo, text, manual_clear=True)) - self.ui.lineEdit_genshinvoice_top_noise.setText(self.genshinvoice_top_config['noise']) - self.ui.lineEdit_genshinvoice_top_noisew.setText(self.genshinvoice_top_config['noisew']) - self.ui.lineEdit_genshinvoice_top_length.setText(self.genshinvoice_top_config['length']) - self.ui.lineEdit_genshinvoice_top_format.setText(self.genshinvoice_top_config['format']) - self.ui.comboBox_genshinvoice_top_language.clear() - self.ui.comboBox_genshinvoice_top_language.addItems(["ZH", "EN", "JP"]) - genshinvoice_top_language_index = 0 - if config.get("genshinvoice_top", "language") == "ZH": - genshinvoice_top_language_index = 0 - elif config.get("genshinvoice_top", "language") == "EN": - genshinvoice_top_language_index = 1 - elif config.get("genshinvoice_top", "language") == "JP": - genshinvoice_top_language_index = 2 - self.ui.comboBox_genshinvoice_top_language.setCurrentIndex(genshinvoice_top_language_index) - - # bark-gui - self.ui.lineEdit_bark_gui_api_ip_port.setText(config.get("bark_gui", "api_ip_port")) - self.ui.lineEdit_bark_gui_spk.setText(config.get("bark_gui", "spk")) - self.ui.lineEdit_bark_gui_generation_temperature.setText(str(config.get("bark_gui", "generation_temperature"))) - self.ui.lineEdit_bark_gui_waveform_temperature.setText(str(config.get("bark_gui", "waveform_temperature"))) - self.ui.lineEdit_bark_gui_end_of_sentence_probability.setText(str(config.get("bark_gui", "end_of_sentence_probability"))) - if config.get("bark_gui", "quick_generation"): - self.ui.checkBox_bark_gui_quick_generation.setChecked(True) - self.ui.lineEdit_bark_gui_seed.setText(str(config.get("bark_gui", "seed"))) - self.ui.lineEdit_bark_gui_batch_count.setText(str(config.get("bark_gui", "batch_count"))) - - # 点歌模式 配置回显部分 - if self.choose_song_config['enable']: - self.ui.checkBox_choose_song_enable.setChecked(True) - self.ui.lineEdit_choose_song_start_cmd.setText(self.choose_song_config['start_cmd']) - self.ui.lineEdit_choose_song_stop_cmd.setText(self.choose_song_config['stop_cmd']) - self.ui.lineEdit_choose_song_random_cmd.setText(self.choose_song_config['random_cmd']) - self.ui.lineEdit_choose_song_song_path.setText(self.choose_song_config['song_path']) - self.ui.lineEdit_choose_song_match_fail_copy.setText(self.choose_song_config['match_fail_copy']) - - # ddsp-svc - if config.get("ddsp_svc", "enable"): - self.ui.checkBox_ddsp_svc_enable.setChecked(True) - self.ui.lineEdit_ddsp_svc_config_path.setText(config.get("ddsp_svc", "config_path")) - self.ui.lineEdit_ddsp_svc_api_ip_port.setText(config.get("ddsp_svc", "api_ip_port")) - self.ui.lineEdit_ddsp_svc_fSafePrefixPadLength.setText(str(config.get("ddsp_svc", "fSafePrefixPadLength"))) - self.ui.lineEdit_ddsp_svc_fPitchChange.setText(str(config.get("ddsp_svc", "fPitchChange"))) - self.ui.lineEdit_ddsp_svc_sSpeakId.setText(str(config.get("ddsp_svc", "sSpeakId"))) - self.ui.lineEdit_ddsp_svc_sampleRate.setText(str(config.get("ddsp_svc", "sampleRate"))) - - if self.so_vits_svc_config['enable']: - self.ui.checkBox_so_vits_svc_enable.setChecked(True) - self.ui.lineEdit_so_vits_svc_config_path.setText(self.so_vits_svc_config['config_path']) - self.ui.lineEdit_so_vits_svc_api_ip_port.setText(self.so_vits_svc_config['api_ip_port']) - self.ui.lineEdit_so_vits_svc_spk.setText(self.so_vits_svc_config['spk']) - self.ui.lineEdit_so_vits_svc_tran.setText(str(self.so_vits_svc_config['tran'])) - self.ui.lineEdit_so_vits_svc_wav_format.setText(self.so_vits_svc_config['wav_format']) - - # sd 配置回显部分 - if self.sd_config['enable']: - self.ui.checkBox_sd_enable.setChecked(True) - self.ui.lineEdit_sd_trigger.setText(self.sd_config['trigger']) - self.ui.comboBox_prompt_llm_type.clear() - self.ui.comboBox_prompt_llm_type.addItems(["chatgpt", "claude", "chatglm", "text_generation_webui", "none"]) - prompt_llm_type_index = 0 - if self.sd_config['prompt_llm']['type'] == "chatgpt": - prompt_llm_type_index = 0 - elif self.sd_config['prompt_llm']['type'] == "claude": - prompt_llm_type_index = 1 - elif self.sd_config['prompt_llm']['type'] == "chatglm": - prompt_llm_type_index = 2 - elif self.sd_config['prompt_llm']['type'] == "text_generation_webui": - prompt_llm_type_index = 3 - elif self.sd_config['prompt_llm']['type'] == "none": - prompt_llm_type_index = 4 - self.ui.comboBox_prompt_llm_type.setCurrentIndex(prompt_llm_type_index) - self.ui.lineEdit_prompt_llm_before_prompt.setText(self.sd_config['prompt_llm']['before_prompt']) - self.ui.lineEdit_prompt_llm_after_prompt.setText(self.sd_config['prompt_llm']['after_prompt']) - self.ui.lineEdit_sd_ip.setText(self.sd_config['ip']) - self.ui.lineEdit_sd_port.setText(str(self.sd_config['port'])) - self.ui.lineEdit_sd_negative_prompt.setText(self.sd_config['negative_prompt']) - self.ui.lineEdit_sd_seed.setText(str(self.sd_config['seed'])) - tmp_str = "" - for tmp in self.sd_config['styles']: - tmp_str = tmp_str + tmp + "\n" - self.ui.textEdit_sd_styles.setText(tmp_str) - self.ui.lineEdit_sd_cfg_scale.setText(str(self.sd_config['cfg_scale'])) - self.ui.lineEdit_sd_steps.setText(str(self.sd_config['steps'])) - self.ui.lineEdit_sd_hr_resize_x.setText(str(self.sd_config['hr_resize_x'])) - self.ui.lineEdit_sd_hr_resize_y.setText(str(self.sd_config['hr_resize_y'])) - if self.sd_config['enable_hr']: - self.ui.checkBox_sd_enable_hr.setChecked(True) - self.ui.lineEdit_sd_hr_scale.setText(str(self.sd_config['hr_scale'])) - self.ui.lineEdit_sd_hr_second_pass_steps.setText(str(self.sd_config['hr_second_pass_steps'])) - self.ui.lineEdit_sd_denoising_strength.setText(str(self.sd_config['denoising_strength'])) - - # 聊天 - self.ui.lineEdit_talk_username.setText(self.talk_config['username']) - if self.talk_config['continuous_talk']: - self.ui.checkBox_talk_continuous_talk.setChecked(True) - self.ui.comboBox_talk_trigger_key.clear() - with open('data\keyboard.txt', 'r') as file: - file_content = file.read() - # 按行分割内容,并去除每行末尾的换行符 - lines = file_content.strip().split('\n') - # 存储到字符串数组中 - trigger_keys = [line for line in lines] - # print(trigger_keys) - self.ui.comboBox_talk_trigger_key.addItems(trigger_keys) - trigger_key_index = trigger_keys.index(self.talk_config['trigger_key']) - self.ui.comboBox_talk_trigger_key.setCurrentIndex(trigger_key_index) - self.ui.comboBox_talk_stop_trigger_key.clear() - self.ui.comboBox_talk_stop_trigger_key.addItems(trigger_keys) - stop_trigger_key_index = trigger_keys.index(self.talk_config['stop_trigger_key']) - self.ui.comboBox_talk_stop_trigger_key.setCurrentIndex(stop_trigger_key_index) - self.ui.comboBox_talk_type.clear() - self.ui.comboBox_talk_type.addItems(["baidu", "google"]) - talk_type_index = 0 - if self.talk_config['type'] == "baidu": - talk_type_index = 0 - elif self.talk_config['type'] == "google": - talk_type_index = 1 - self.ui.comboBox_talk_type.setCurrentIndex(talk_type_index) - self.ui.lineEdit_talk_volume_threshold.setText(str(self.talk_config['volume_threshold'])) - self.ui.lineEdit_talk_silence_threshold.setText(str(self.talk_config['silence_threshold'])) - self.ui.lineEdit_talk_baidu_app_id.setText(self.talk_config['baidu']['app_id']) - self.ui.lineEdit_talk_baidu_api_key.setText(self.talk_config['baidu']['api_key']) - self.ui.lineEdit_talk_baidu_secret_key.setText(self.talk_config['baidu']['secret_key']) - self.ui.comboBox_talk_google_tgt_lang.clear() - self.ui.comboBox_talk_google_tgt_lang.addItems(["zh-CN", "en-US", "ja-JP"]) - talk_google_tgt_lang_index = 0 - if self.talk_config['google']['tgt_lang'] == "zh-CN": - talk_google_tgt_lang_index = 0 - elif self.talk_config['google']['tgt_lang'] == "en-US": - talk_google_tgt_lang_index = 1 - elif self.talk_config['google']['tgt_lang'] == "ja-JP": - talk_google_tgt_lang_index = 2 - self.ui.comboBox_talk_google_tgt_lang.setCurrentIndex(talk_google_tgt_lang_index) - - # 连接回车按键的信号与槽 - self.ui.textEdit_talk_chat_box.installEventFilter(self) - - """ - GUI部分 动态生成的widget - 推荐使用这种形式进行UI加载,更具动态,不过目前封装实现还是垃圾了些,不是很好用,待优化 - """ - # 自定义显隐各板块 - def get_box_name_by_key(key): - # 定义键和值的映射关系,请和配置文件中的键保持一致 - # 添加时需要同步给配置文件中的show_box配置项追加你添加的键名 - key_value_map = { - "read_comment": "念弹幕", - "read_user_name": "念用户名", - "filter": "过滤", - "thanks": "答谢", - "live2d": "Live2D", - "audio_random_speed": "音频随机变速", - "so_vits_svc": "so-vits-svc", - "ddsp_svc": "DDSP-SVC", - "local_qa": "本地问答", - "choose_song": "点歌模式", - "sd": "Stable Diffusion", - "log": "日志", - "schedule": "定时任务", - "idle_time_task": "闲时任务", - "database": "数据库", - "play_audio": "播放音频", - "web_captions_printer": "web字幕打印机", - "key_mapping": "按键映射", - "unity": "Unity", - # 可以继续添加其他键和值 - } - - # 查找并返回对应的值,如果找不到键则返回None - return key_value_map.get(key) - - data_json = [] - # 遍历字典并获取键名和对应值 - for index, (key, value) in enumerate(config.get("show_box").items()): - tmp_json = { - "label_text": "", - "label_tip": "", - "data": value, - "widget_text": get_box_name_by_key(key), - "click_func": "show_box", - "main_obj_name": key, - "index": index - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row, col, max_col = 0, 0, 3 - for widget in widgets: - self.ui.gridLayout_show_box.addWidget(widget, row, col) - col += 1 - if col > max_col: - col = 0 - row += 1 - - - # 定时任务动态加载 - data_json = [] - for index, tmp in enumerate(config.get("schedule")): - tmp_json = { - "label_text": "任务" + str(index), - "label_tip": "是否启用此定时任务", - "data": tmp["enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "schedule", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "循环周期", - "label_tip": "定时任务循环的周期时长(秒),即每间隔这个周期就会执行一次", - "data": tmp["time"], - "main_obj_name": "schedule", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案列表", - "label_tip": "存放文案的列表,通过空格或换行分割,通过{变量}来替换关键数据,可修改源码自定义功能", - "data": tmp["copy"], - "main_obj_name": "schedule", - "index": index - } - data_json.append(tmp_json) - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_schedule.addWidget(widgets[i], row, 0) - self.ui.gridLayout_schedule.addWidget(widgets[i + 1], row, 1) - row += 1 - - # 闲时任务动态加载 - def idle_time_task_gui_create(): - data_json = [] - idle_time_task_config = config.get("idle_time_task") - - tmp_json = { - "label_text": "闲时任务", - "label_tip": "是否启用闲时任务", - "data": idle_time_task_config["enable"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "闲时时间", - "label_tip": "闲时间隔时间(正整数),就是在没有弹幕情况下经过的时间", - "data": idle_time_task_config["idle_time"], - "main_obj_name": "zhipu", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "随机闲时时间", - "label_tip": "是否启用随机闲时时间,从0到闲时时间随机一个数", - "data": idle_time_task_config["random_time"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 2 - } - data_json.append(tmp_json) - - # logging.info(data_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_idle_time_task.addWidget(widgets[i], row, 0) - self.ui.gridLayout_idle_time_task.addWidget(widgets[i + 1], row, 1) - row += 1 - - idle_time_task_gui_create() - - def idle_time_task_comment_gui_create(): - data_json = [] - idle_time_task_config = config.get("idle_time_task") - - tmp_json = { - "label_text": "LLM模式", - "label_tip": "是否启用LLM模式", - "data": idle_time_task_config["comment"]["enable"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 3 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "随机文案", - "label_tip": "是否启用随机文案,打乱文案触发顺序", - "data": idle_time_task_config["comment"]["random"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 4 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案列表", - "label_tip": "文案列表,文案之间用换行分隔,文案会丢LLM进行处理后直接合成返回的结果", - "data": idle_time_task_config["comment"]["copy"], - "main_obj_name": "idle_time_task", - "index": 5 - } - data_json.append(tmp_json) - - # logging.info(data_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_idle_time_task_comment.addWidget(widgets[i], row, 0) - self.ui.gridLayout_idle_time_task_comment.addWidget(widgets[i + 1], row, 1) - row += 1 - - idle_time_task_comment_gui_create() - - def idle_time_task_local_audio_gui_create(): - data_json = [] - idle_time_task_config = config.get("idle_time_task") - - tmp_json = { - "label_text": "本地音频模式", - "label_tip": "是否启用本地音频模式", - "data": idle_time_task_config["local_audio"]["enable"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 6 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "随机本地音频", - "label_tip": "是否启用随机本地音频,打乱本地音频触发顺序", - "data": idle_time_task_config["local_audio"]["random"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "idle_time_task", - "index": 7 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "本地音频路径列表", - "label_tip": "本地音频路径列表,相对/绝对路径之间用换行分隔,音频文件会直接丢进音频播放队列", - "data": idle_time_task_config["local_audio"]["path"], - "main_obj_name": "idle_time_task", - "index": 8 - } - data_json.append(tmp_json) - - # logging.info(data_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_idle_time_task_local_audio.addWidget(widgets[i], row, 0) - self.ui.gridLayout_idle_time_task_local_audio.addWidget(widgets[i + 1], row, 1) - row += 1 - - idle_time_task_local_audio_gui_create() - - # 文案配置动态加载 - self.ui.lineEdit_copywriting_audio_interval.setText(str(self.copywriting_config['audio_interval'])) - self.ui.lineEdit_copywriting_switching_interval.setText(str(self.copywriting_config['switching_interval'])) - if self.copywriting_config['auto_play']: - self.ui.checkBox_copywriting_switching_auto_play.setChecked(True) - if self.copywriting_config['random_play']: - self.ui.checkBox_copywriting_switching_random_play.setChecked(True) - - data_json = [] - for index, tmp in enumerate(config.get("copywriting", "config")): - tmp_json = { - "label_text": "文案存储路径" + str(index), - "label_tip": "文案文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["file_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_file_path", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "音频存储路径" + str(index), - "label_tip": "文案音频文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["audio_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_path", - "index": index - } - data_json.append(tmp_json) - - tmp_str = "" - copywriting_file_names = self.get_dir_txt_filename(self.copywriting_config["config"][index]['file_path']) - for tmp_copywriting_file_name in copywriting_file_names: - tmp_str = tmp_str + tmp_copywriting_file_name + "\n" - tmp_json = { - "label_text": "文案列表" + str(index), - "label_tip": "加载配置文件中配置的文案路径下的所有文件,请勿放入其他非文案文件", - "data": [tmp_str], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_copywriting_list", - "readonly": True, - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "播放列表" + str(index), - "label_tip": "此处填写需要播放的音频文件全名,填写完毕后点击 保存配置。文件全名从音频列表中复制,换行分隔,请勿随意填写", - "data": tmp["play_list"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_play_list", - "index": index - } - data_json.append(tmp_json) - - tmp_str = "" - copywriting_audio_file_names = self.get_dir_audio_filename(self.copywriting_config["config"][index]['audio_path']) - for tmp_copywriting_audio_file_name in copywriting_audio_file_names: - tmp_str = tmp_str + tmp_copywriting_audio_file_name + "\n" - tmp_json = { - "label_text": "已合成\n音频列表" + str(index), - "label_tip": "加载配置文件中配置的音频路径下的所有文件,请勿放入其他非音频文件", - "data": [tmp_str], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_list", - "readonly": True, - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放数" + str(index), - "label_tip": "文案播放列表中连续播放的音频文件个数,如果超过了这个个数就会切换下一个文案列表", - "data": tmp["continuous_play_num"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_continuous_play_num", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放时间" + str(index), - "label_tip": "文案播放列表中连续播放音频的时长,如果超过了这个时长就会切换下一个文案列表", - "data": tmp["max_play_time"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_max_play_time", - "index": index - } - data_json.append(tmp_json) - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_copywriting_config.addWidget(widgets[i], row, 0) - self.ui.gridLayout_copywriting_config.addWidget(widgets[i + 1], row, 1) - row += 1 - - # 智谱AI - def zhipu_gui_create(): - data_json = [] - zhipu_config = config.get("zhipu") - - tmp_json = { - "label_text": "api key", - "label_tip": "具体参考官方文档,申请地址:https://open.bigmodel.cn/usercenter/apikeys", - "data": zhipu_config["api_key"], - "main_obj_name": "zhipu", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "模型", - "label_tip": "使用的语言模型", - "widget_type": "combo_box", - "combo_data_list": ['chatglm_pro', 'chatglm_std', 'chatglm_lite', 'chatglm_lite_32k', 'characterglm'], - "data": zhipu_config["model"], - "main_obj_name": "zhipu", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "top_p", - "label_tip": "用温度取样的另一种方法,称为核取样\n取值范围是:(0.0,1.0);开区间,不能等于 0 或 1,默认值为 0.7\n模型考虑具有 top_p 概率质量的令牌的结果。所以 0.1 意味着模型解码器只考虑从前 10% 的概率的候选集中取tokens\n建议您根据应用场景调整 top_p 或 temperature 参数,但不要同时调整两个参数", - "data": zhipu_config["top_p"], - "main_obj_name": "zhipu", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "temperature", - "label_tip": "采样温度,控制输出的随机性,必须为正数\n取值范围是:(0.0,1.0],不能等于 0,默认值为 0.95\n值越大,会使输出更随机,更具创造性;值越小,输出会更加稳定或确定\n建议您根据应用场景调整 top_p 或 temperature 参数,但不要同时调整两个参数", - "data": zhipu_config["temperature"], - "main_obj_name": "zhipu", - "index": 3 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "上下文记忆", - "label_tip": "是否开启上下文记忆功能,可以记住前面说的内容", - "data": zhipu_config["history_enable"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "zhipu", - "index": 4 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "最大记忆长度", - "label_tip": "最长能记忆的问答字符串长度,超长会丢弃最早记忆的内容,请慎用!配置过大可能会有丢大米", - "data": zhipu_config["history_max_len"], - "main_obj_name": "zhipu", - "index": 5 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "用户信息", - "label_tip": "用户信息,当使用characterglm时需要配置", - "data": zhipu_config["user_info"], - "main_obj_name": "zhipu", - "index": 6 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "角色信息", - "label_tip": "角色信息,当使用characterglm时需要配置", - "data": zhipu_config["bot_info"], - "main_obj_name": "zhipu", - "index": 7 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "角色名称", - "label_tip": "角色名称,当使用characterglm时需要配置", - "data": zhipu_config["bot_name"], - "main_obj_name": "zhipu", - "index": 8 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "用户名称", - "label_tip": "用户名称,默认值为用户,当使用characterglm时需要配置", - "data": zhipu_config["user_name"], - "main_obj_name": "zhipu", - "index": 9 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "删除无用符号", - "label_tip": "是否开启删除无用符号功能,因为模型会有心理描述和啥特殊字符的内容,不需要的可以开启", - "data": zhipu_config["remove_useless"], - "widget_text": "启用", - "click_func": "", - "main_obj_name": "zhipu", - "index": 10 - } - data_json.append(tmp_json) - - # logging.info(data_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_zhipu.addWidget(widgets[i], row, 0) - self.ui.gridLayout_zhipu.addWidget(widgets[i + 1], row, 1) - row += 1 - - zhipu_gui_create() - - # VITS - def vits_gui_create(): - data_json = [] - - vits_config = config.get("vits") - tmp_json = { - "label_text": "类型", - "label_tip": "选用的TTS模型", - "widget_type": "combo_box", - "combo_data_list": ["vits", "bert_vits2"], - "data": vits_config["type"], - "main_obj_name": "vits", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "配置文件路径", - "label_tip": "模型配置文件存储路径", - "data": vits_config["config_path"], - "main_obj_name": "vits", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "API地址", - "label_tip": "vits-simple-api启动后监听的ip端口地址", - "data": vits_config["api_ip_port"], - "main_obj_name": "vits", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "说话人ID", - "label_tip": "API启动时会给配置文件重新划分id,一般为拼音顺序排列,从0开始", - "data": vits_config["id"], - "main_obj_name": "vits", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "语言", - "label_tip": "auto为自动识别语言模式,也是默认模式。lang=mix时,文本应该用[ZH] 或 [JA] 包裹。方言无法自动识别。", - "widget_type": "combo_box", - "combo_data_list": ["自动", "中文", "英文", "日文"], - "data": vits_config["lang"], - "main_obj_name": "vits", - "index": 4 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "语音长度", - "label_tip": "调节语音长度,相当于调节语速,该数值越大语速越慢", - "data": vits_config["length"], - "main_obj_name": "vits", - "index": 5 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "噪声", - "label_tip": "控制感情变化程度", - "data": vits_config["noise"], - "main_obj_name": "vits", - "index": 6 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "噪声偏差", - "label_tip": "控制音素发音长度", - "data": vits_config["noisew"], - "main_obj_name": "vits", - "index": 7 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "分段阈值", - "label_tip": "按标点符号分段,加起来大于max时为一段文本。max<=0表示不分段。", - "data": vits_config["max"], - "main_obj_name": "vits", - "index": 8 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "音频格式", - "label_tip": "支持wav,ogg,silk,mp3,flac", - "data": vits_config["format"], - "main_obj_name": "vits", - "index": 9 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "SDP/DP混合比", - "label_tip": "SDP/DP混合比:SDP在合成时的占比,理论上此比率越高,合成的语音语调方差越大。", - "data": vits_config["sdp_radio"], - "main_obj_name": "vits", - "index": 10 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_vits.addWidget(widgets[i], row, 0) - self.ui.gridLayout_vits.addWidget(widgets[i + 1], row, 1) - row += 1 - - vits_gui_create() - - # 数据库 - def database_gui_create(): - data_json = [] - - database_config = config.get("database") - tmp_json = { - "label_text": "数据库路径", - "label_tip": "数据库文件存储路径", - "data": database_config["path"], - "main_obj_name": "database", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "弹幕日志", - "label_tip": "存储记录原始的用户弹幕数据,用于后期排查问题、分析用户画像等", - "data": database_config["comment_enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "database", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "入场日志", - "label_tip": "存储记录原始的用户入场数据,用于后期排查问题、分析流量等", - "data": database_config["entrance_enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "database", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "礼物日志", - "label_tip": "存储记录原始的用户礼物数据,用于后期排查问题、分析富哥富婆等", - "data": database_config["gift_enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "database", - "index": 1 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_database.addWidget(widgets[i], row, 0) - self.ui.gridLayout_database.addWidget(widgets[i + 1], row, 1) - row += 1 - - database_gui_create() - - # 播放音频 - def play_audio_gui_create(): - data_json = [] - - play_audio_config = config.get("play_audio") - tmp_json = { - "label_text": "启用", - "label_tip": "是否开启音频播放,如果不启用,则会只合成音频文件,不会进行播放操作", - "data": play_audio_config["enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "play_audio", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "音频输出路径", - "label_tip": "音频文件合成后存储的路径,支持相对路径或绝对路径", - "data": play_audio_config["out_path"], - "main_obj_name": "play_audio", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "播放器", - "label_tip": "选择不同播放器播放音频,播放器不同,处理逻辑也有所不同", - "widget_type": "combo_box", - "combo_data_list": ['pygame', 'audio_player'], - "data": play_audio_config["player"], - "main_obj_name": "play_audio", - "index": 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_play_audio.addWidget(widgets[i], row, 0) - self.ui.gridLayout_play_audio.addWidget(widgets[i + 1], row, 1) - row += 1 - - play_audio_gui_create() - - # audio_player - def audio_player_gui_create(): - data_json = [] - - audio_player_config = config.get("audio_player") - tmp_json = { - "label_text": "API地址", - "label_tip": "audio_player的API地址,只需要 http://ip:端口 即可", - "data": audio_player_config["api_ip_port"], - "main_obj_name": "audio_player", - "index": 0 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_audio_player.addWidget(widgets[i], row, 0) - self.ui.gridLayout_audio_player.addWidget(widgets[i + 1], row, 1) - row += 1 - - audio_player_gui_create() - - # 动态文案 - self.ui.checkBox_trends_copywriting_enable.setChecked(config.get("trends_copywriting", "enable")) - self.ui.checkBox_trends_copywriting_random_play.setChecked(config.get("trends_copywriting", "random_play")) - self.ui.lineEdit_trends_copywriting_play_interval.setText(str(config.get("trends_copywriting", "play_interval"))) - def trends_copywriting_gui_create(): - data_json = [] - - trends_copywriting_config = config.get("trends_copywriting", "copywriting") - for tmp in trends_copywriting_config: - tmp_json = { - "label_text": "文案路径", - "label_tip": "文案文件存储的文件夹路径", - "data": tmp["folder_path"], - "main_obj_name": "trends_copywriting", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "提示词转换", - "label_tip": "是否启用提示词对文案内容进行转换", - "data": tmp["prompt_change_enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "trends_copywriting", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "提示词转换内容", - "label_tip": "使用此提示词内容对文案内容进行转换后再进行合成,使用的LLM为聊天类型配置", - "data": tmp["prompt_change_content"], - "main_obj_name": "trends_copywriting", - "index": 0 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_trends_copywriting_2.addWidget(widgets[i], row, 0) - self.ui.gridLayout_trends_copywriting_2.addWidget(widgets[i + 1], row, 1) - row += 1 - - trends_copywriting_gui_create() - - # web字幕打印机 - def web_captions_printer_gui_create(): - data_json = [] - - web_captions_printer_config = config.get("web_captions_printer") - tmp_json = { - "label_text": "启用", - "label_tip": "是否启用web字幕打印机功能(需要先启动web字幕打印机程序才能使用)", - "data": web_captions_printer_config["enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "web_captions_printer", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "API地址", - "label_tip": "web字幕打印机的API地址,只需要 http://ip:端口 即可", - "data": web_captions_printer_config["api_ip_port"], - "main_obj_name": "web_captions_printer", - "index": 1 - } - data_json.append(tmp_json) - - # tmp_json = { - # "label_text": "类型", - # "label_tip": "发送给web字幕打印机内容,可以自定义哪些内容发过去显示", - # "widget_type": "combo_box", - # "combo_data_list": ["弹幕", "回复", "复读", "弹幕+回复", "回复+复读", "弹幕+回复+复读"], - # "data": web_captions_printer_config["type"], - # "main_obj_name": "web_captions_printer", - # "index": 1 - # } - # data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_web_captions_printer.addWidget(widgets[i], row, 0) - self.ui.gridLayout_web_captions_printer.addWidget(widgets[i + 1], row, 1) - row += 1 - - web_captions_printer_gui_create() - - # VALL-E-X - def vall_e_x_gui_create(): - data_json = [] - vall_e_x_config = config.get("vall_e_x") - - tmp_json = { - "label_text": "API地址", - "label_tip": "VALL-E-X启动后监听的ip端口地址", - "data": vall_e_x_config["api_ip_port"], - "main_obj_name": "vall_e_x", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "language", - "label_tip": "VALL-E-X language", - "widget_type": "combo_box", - "combo_data_list": ['auto-detect', 'English', '中文', '日本語', 'Mix'], - "data": vall_e_x_config["language"], - "main_obj_name": "vall_e_x", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "accent", - "label_tip": "VALL-E-X accent", - "widget_type": "combo_box", - "combo_data_list": ['no-accent', 'English', '中文', '日本語'], - "data": vall_e_x_config["accent"], - "main_obj_name": "vall_e_x", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "voice preset", - "label_tip": "VALL-E-X说话人预设名(Prompt name)", - "data": vall_e_x_config["voice_preset"], - "main_obj_name": "vall_e_x", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "voice_preset_file_path", - "label_tip": "VALL-E-X说话人预设文件路径(npz)", - "data": vall_e_x_config["voice_preset_file_path"], - "main_obj_name": "vall_e_x", - "index": 1 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_vall_e_x.addWidget(widgets[i], row, 0) - self.ui.gridLayout_vall_e_x.addWidget(widgets[i + 1], row, 1) - row += 1 - - vall_e_x_gui_create() - - # OpenAI TTS - def openai_tts_gui_create(): - data_json = [] - openai_tts_config = config.get("openai_tts") - - tmp_json = { - "label_text": "type", - "label_tip": "类型", - "widget_type": "combo_box", - "combo_data_list": ['api', 'huggingface'], - "data": openai_tts_config["type"], - "main_obj_name": "openai_tts", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "API地址", - "label_tip": "huggingface适配项目的API地址", - "data": openai_tts_config["api_ip_port"], - "main_obj_name": "openai_tts", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "模型", - "label_tip": "使用的模型", - "widget_type": "combo_box", - "combo_data_list": ['tts-1', 'tts-1-hd'], - "data": openai_tts_config["model"], - "main_obj_name": "openai_tts", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "voice", - "label_tip": "说话人", - "widget_type": "combo_box", - "combo_data_list": ['alloy', 'echo', 'fable', 'onyx', 'nova', 'shimmer'], - "data": openai_tts_config["voice"], - "main_obj_name": "openai_tts", - "index": 3 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "API Key", - "label_tip": "OpenAI API Key", - "data": openai_tts_config["api_key"], - "main_obj_name": "openai_tts", - "index": 4 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_openai_tts.addWidget(widgets[i], row, 0) - self.ui.gridLayout_openai_tts.addWidget(widgets[i + 1], row, 1) - row += 1 - - openai_tts_gui_create() - - # 哔哩哔哩 - def bilibili_gui_create(): - data_json = [] - bilibili_config = config.get("bilibili") - - tmp_json = { - "label_text": "登录方式", - "label_tip": "选择登录b站账号的方式,用于获取b站账号相关信息", - "widget_type": "combo_box", - "combo_data_list": ['手机扫码', '手机扫码-终端', 'cookie', '账号密码登录', 'open_live', '不登录'], - "data": bilibili_config["login_type"], - "main_obj_name": "bilibili", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "cookie", - "label_tip": "b站登录后F12抓网络包获取cookie,强烈建议使用小号!有封号风险", - "data": bilibili_config["cookie"], - "main_obj_name": "bilibili", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "ac_time_value", - "label_tip": "b站登录后,F12控制台,输入window.localStorage.ac_time_value获取(如果没有,请重新登录)", - "data": bilibili_config["ac_time_value"], - "main_obj_name": "bilibili", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "用户名", - "label_tip": "b站账号(建议使用小号)", - "data": bilibili_config["username"], - "main_obj_name": "bilibili", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "密码", - "label_tip": "b站密码(建议使用小号)", - "data": bilibili_config["password"], - "main_obj_name": "bilibili", - "index": 3 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_bilibili.addWidget(widgets[i], row, 0) - self.ui.gridLayout_bilibili.addWidget(widgets[i + 1], row, 1) - row += 1 - - bilibili_gui_create() - - # twitch - def twitch_gui_create(): - data_json = [] - twitch_config = config.get("twitch") - - tmp_json = { - "label_text": "token", - "label_tip": "访问 https://twitchapps.com/tmi/ 获取,格式为:oauth:xxx", - "data": twitch_config["token"], - "main_obj_name": "twitch", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "用户名", - "label_tip": "你的twitch账号用户名", - "data": twitch_config["user"], - "main_obj_name": "twitch", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "HTTP代理IP地址", - "label_tip": "代理软件,http协议监听的ip地址,一般为:127.0.0.1", - "data": twitch_config["proxy_server"], - "main_obj_name": "twitch", - "index": 3 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "HTTP代理端口", - "label_tip": "代理软件,http协议监听的端口,一般为:1080", - "data": twitch_config["proxy_port"], - "main_obj_name": "twitch", - "index": 4 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_twitch.addWidget(widgets[i], row, 0) - self.ui.gridLayout_twitch.addWidget(widgets[i + 1], row, 1) - row += 1 - - twitch_gui_create() - - # bard - def bard_gui_create(): - data_json = [] - bard_config = config.get("bard") - - tmp_json = { - "label_text": "token", - "label_tip": "登录bard,打开F12,在cookie中获取 __Secure-1PSID 对应的值", - "data": bard_config["token"], - "main_obj_name": "bard", - "index": 1 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_bard.addWidget(widgets[i], row, 0) - self.ui.gridLayout_bard.addWidget(widgets[i + 1], row, 1) - row += 1 - - bard_gui_create() - - # 文心一言 - def yiyan_gui_create(): - data_json = [] - yiyan_config = config.get("yiyan") - - tmp_json = { - "label_text": "API地址", - "label_tip": "yiyan-api启动后监听的ip端口地址", - "data": yiyan_config["api_ip_port"], - "main_obj_name": "yiyan", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "类型", - "label_tip": "使用的接口类型,暂时只提供web版", - "widget_type": "combo_box", - "combo_data_list": ['web'], - "data": yiyan_config["type"], - "main_obj_name": "yiyan", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "cookie", - "label_tip": "文心一言登录后,跳过debug后,抓取请求包中的cookie", - "data": yiyan_config["cookie"], - "main_obj_name": "yiyan", - "index": 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_yiyan.addWidget(widgets[i], row, 0) - self.ui.gridLayout_yiyan.addWidget(widgets[i + 1], row, 1) - row += 1 - - yiyan_gui_create() - - # 通义千问 - def tongyi_gui_create(): - data_json = [] - tongyi_config = config.get("tongyi") - - tmp_json = { - "label_text": "类型", - "label_tip": "使用的接口类型,暂时只提供web版", - "widget_type": "combo_box", - "combo_data_list": ['web'], - "data": tongyi_config["type"], - "main_obj_name": "tongyi", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "cookie路径", - "label_tip": "通义千问登录后,通过浏览器插件Cookie Editor获取Cookie JSON串,然后将数据保存在这个路径的文件中", - "data": tongyi_config["cookie_path"], - "main_obj_name": "tongyi", - "index": 1 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_tongyi.addWidget(widgets[i], row, 0) - self.ui.gridLayout_tongyi.addWidget(widgets[i + 1], row, 1) - row += 1 - - tongyi_gui_create() - - # 念弹幕 - def read_comment_create(): - data_json = [] - read_comment_config = config.get("read_comment") - - tmp_json = { - "label_text": "念弹幕", - "label_tip": "是否启用念弹幕的功能", - "data": read_comment_config["enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "read_comment", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "念用户名", - "label_tip": "是否启用念用户名的功能,就是说在念弹幕的前面顺便把用户名念一下", - "data": read_comment_config["read_username_enable"], - "widget_text": "", - "click_func": "", - "main_obj_name": "read_comment", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "变声", - "label_tip": "是否启用变声功能,会使用已配置的变声内容来进行变声", - "data": read_comment_config["voice_change"], - "widget_text": "", - "click_func": "", - "main_obj_name": "read_comment", - "index": 2 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "念用户名文案", - "label_tip": "念用户名时使用的文案,可以自定义编辑多个(换行分隔),实际中会随机一个使用", - "data": read_comment_config["read_username_copywriting"], - "main_obj_name": "read_comment", - "index": 3 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_read_comment.addWidget(widgets[i], row, 0) - self.ui.gridLayout_read_comment.addWidget(widgets[i + 1], row, 1) - row += 1 - - read_comment_create() - - # 按键映射 - self.ui.checkBox_key_mapping_enable.setChecked(config.get("key_mapping", "enable")) - self.ui.comboBox_key_mapping_type.clear() - self.ui.comboBox_key_mapping_type.addItems(["弹幕", "回复", "弹幕+回复"]) - key_mapping_type_index = 0 - if config.get('key_mapping', 'type') == "弹幕": - key_mapping_type_index = 0 - elif config.get('key_mapping', 'type') == "回复": - key_mapping_type_index = 1 - elif config.get('key_mapping', 'type') == "弹幕+回复": - key_mapping_type_index = 2 - self.ui.comboBox_key_mapping_type.setCurrentIndex(key_mapping_type_index) - self.ui.lineEdit_key_mapping_start_cmd.setText(config.get("key_mapping", "start_cmd")) - - def key_mapping_config_create(): - data_json = [] - for index, tmp in enumerate(config.get("key_mapping", "config")): - tmp_json = { - "label_text": "关键词#" + str(index), - "label_tip": "触发按键映射的关键词,可以配置多个,用换行进行分隔", - "data": tmp["keywords"], - "main_obj_name": "key_mapping_config", - "index": 3 * index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "按键#" + str(index), - "label_tip": "触发按键映射的对应的按键(参考pyautogui文档配置),可以配置多个,用换行进行分隔", - "data": tmp["keys"], - "main_obj_name": "key_mapping_config", - "index": 3 * index + 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "相似度#" + str(index), - "label_tip": "关键词命中的相似度,默认1为100%命中后才会触发", - "data": tmp["similarity"], - "main_obj_name": "key_mapping_config", - "index": 3 * index + 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_key_mapping_config.addWidget(widgets[i], row, 0) - self.ui.gridLayout_key_mapping_config.addWidget(widgets[i + 1], row, 1) - row += 1 - - key_mapping_config_create() - - """ - 积分页 - """ - self.ui.checkBox_integral_common_enable.setChecked(config.get("integral", "enable")) - - # 入场-文案 - def integral_entrance_copywriting_create(): - data_json = [] - for index, tmp in enumerate(config.get("integral", "entrance", "copywriting")): - tmp_json = { - "label_text": "入场数区间" + str(index), - "label_tip": "限制在此区间内的入场数来触发对应的文案,用-号来进行区间划分,包含边界值", - "data": tmp["entrance_num_interval"], - "main_obj_name": "integral_entrance_copywriting_entrance_num_interval", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案" + str(index), - "label_tip": "在此入场区间内,触发的文案内容,换行分隔", - "data": tmp["copywriting"], - "widget_text": "", - "click_func": "", - "main_obj_name": "integral_entrance_copywriting_copywriting", - "index": index - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_entrance_copywriting.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_entrance_copywriting.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_entrance_copywriting_create() - - # 入场 - def integral_entrance_create(): - data_json = [] - integral_entrance_config = config.get("integral", "entrance") - - tmp_json = { - "label_text": "启用入场", - "label_tip": "是否启用入场功能", - "data": integral_entrance_config["enable"], - "widget_text": "是", - "click_func": "", - "main_obj_name": "integral_entrance", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "获得积分数", - "label_tip": "入场可以获得的积分数,请填写正整数!", - "data": integral_entrance_config["get_integral"], - "main_obj_name": "integral_entrance", - "index": 1 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_entrance.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_entrance.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_entrance_create() - - # 签到-文案 - def integral_sign_copywriting_create(): - data_json = [] - for index, tmp in enumerate(config.get("integral", "sign", "copywriting")): - tmp_json = { - "label_text": "签到数区间" + str(index), - "label_tip": "限制在此区间内的签到数来触发对应的文案,用-号来进行区间划分,包含边界值", - "data": tmp["sign_num_interval"], - "main_obj_name": "integral_sign_copywriting_sign_num_interval", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案" + str(index), - "label_tip": "在此签到区间内,触发的文案内容,换行分隔", - "data": tmp["copywriting"], - "widget_text": "", - "click_func": "", - "main_obj_name": "integral_sign_copywriting_copywriting", - "index": index - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_sign_copywriting.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_sign_copywriting.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_sign_copywriting_create() - - # 签到 - def integral_sign_create(): - data_json = [] - integral_sign_config = config.get("integral", "sign") - - tmp_json = { - "label_text": "启用签到", - "label_tip": "是否启用签到功能", - "data": integral_sign_config["enable"], - "widget_text": "是", - "click_func": "", - "main_obj_name": "integral_sign", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "签到命令", - "label_tip": "弹幕发送以下命令可以触发签到功能,换行分隔命令", - "data": integral_sign_config["cmd"], - "main_obj_name": "integral_sign", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "获得积分数", - "label_tip": "签到成功可以获得的积分数,请填写正整数!", - "data": integral_sign_config["get_integral"], - "main_obj_name": "integral_sign", - "index": 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_sign.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_sign.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_sign_create() - - # 礼物-文案 - def integral_gift_copywriting_create(): - data_json = [] - for index, tmp in enumerate(config.get("integral", "gift", "copywriting")): - tmp_json = { - "label_text": "礼物价格区间" + str(index), - "label_tip": "限制在此区间内的礼物价格来触发对应的文案,用-号来进行区间划分,包含边界值", - "data": tmp["gift_price_interval"], - "main_obj_name": "integral_gift_copywriting_gift_price_interval", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案" + str(index), - "label_tip": "在此礼物区间内,触发的文案内容,换行分隔", - "data": tmp["copywriting"], - "widget_text": "", - "click_func": "", - "main_obj_name": "integral_gift_copywriting_copywriting", - "index": index - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_gift_copywriting.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_gift_copywriting.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_gift_copywriting_create() - - # 礼物 - def integral_gift_create(): - data_json = [] - integral_gift_config = config.get("integral", "gift") - - tmp_json = { - "label_text": "启用礼物", - "label_tip": "是否启用礼物功能", - "data": integral_gift_config["enable"], - "widget_text": "是", - "click_func": "", - "main_obj_name": "integral_gift", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "获得积分比例", - "label_tip": "此比例和礼物真实金额(元)挂钩,默认就是1元=10积分", - "data": integral_gift_config["get_integral_proportion"], - "main_obj_name": "integral_gift", - "index": 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_gift.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_gift.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_gift_create() - - # 增删改查 - # 查询 - def integral_crud_query_create(): - data_json = [] - integral_crud_query_config = config.get("integral", "crud", "query") - - tmp_json = { - "label_text": "启用查询", - "label_tip": "是否启用查询功能", - "data": integral_crud_query_config["enable"], - "widget_text": "是", - "click_func": "", - "main_obj_name": "integral_crud_query", - "index": 0 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "查询命令", - "label_tip": "弹幕发送以下命令可以触发查询功能,换行分隔命令", - "data": integral_crud_query_config["cmd"], - "main_obj_name": "integral_crud_query", - "index": 1 - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案", - "label_tip": "触发查询功能后返回的文案内容,换行分隔命令", - "data": integral_crud_query_config["copywriting"], - "main_obj_name": "integral_crud_query", - "index": 2 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_integral_crud_query.addWidget(widgets[i], row, 0) - self.ui.gridLayout_integral_crud_query.addWidget(widgets[i + 1], row, 1) - row += 1 - - integral_crud_query_create() - - # xuniren - def xuniren_create(): - data_json = [] - - xuniren_config = config.get("xuniren") - - tmp_json = { - "label_text": "API地址", - "label_tip": "xuniren应用启动API后,监听的ip和端口", - "data": xuniren_config["api_ip_port"], - "main_obj_name": "xuniren", - "index": 0 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_xuniren.addWidget(widgets[i], row, 0) - self.ui.gridLayout_xuniren.addWidget(widgets[i + 1], row, 1) - row += 1 - - xuniren_create() - - # unity - def unity_create(): - data_json = [] - - unity_config = config.get("unity") - - # tmp_json = { - # "label_text": "Unity中转", - # "label_tip": "是否启用Unity中转功能", - # "data": unity_config["enable"], - # "widget_text": "启用", - # "click_func": "", - # "main_obj_name": "unity", - # "index": 0 - # } - # data_json.append(tmp_json) - - tmp_json = { - "label_text": "API地址", - "label_tip": "对接Unity应用使用的HTTP中转站监听的ip和端口", - "data": unity_config["api_ip_port"], - "main_obj_name": "unity", - "index": 0 - } - data_json.append(tmp_json) - - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - # 分2列,左边就是label说明,右边就是输入框等 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_unity.addWidget(widgets[i], row, 0) - self.ui.gridLayout_unity.addWidget(widgets[i + 1], row, 1) - row += 1 - - unity_create() - - """ - ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ - ------------------------------------------------------------------------------------------------------------- - """ - - # 显隐各板块 - self.oncomboBox_chat_type_IndexChanged(chat_type_index) - self.oncomboBox_audio_synthesis_type_IndexChanged(audio_synthesis_type_index) - self.oncomboBox_talk_type_IndexChanged(talk_type_index) - - # 打开Live2D页面 - # if self.live2d_config["enable"]: - # url = QUrl("http://127.0.0.1:12345/Live2D/") # 指定要打开的网页地址 - # QDesktopServices.openUrl(url) - - logging.info("配置文件加载成功。") - except Exception as e: - logging.error(traceback.format_exc()) - return None - - - # ui初始化 - def init_ui(self): - # 统一设置下样式先 - comboBox_common_css = ''' - margin: 5px 0px; - height: 40px; - background-color: rgba(255, 255, 255, 100); - ''' - - # 无效设置 - font = QFont("仿宋", 14) # 创建一个字体对象 - font.setWeight(QFont.Bold) # 设置字体粗细 - - comboBoxs = self.findChildren(QComboBox) - for comboBox in comboBoxs: - comboBox.setStyleSheet(comboBox_common_css) - comboBox.setFont(font) - - label_common_css = ''' - background-color: rgba(255, 255, 255, 0); - ''' - - labels = self.findChildren(QLabel) - for label in labels: - label.setStyleSheet(label_common_css) - label.setFont(font) - - - groupBox_common_css = ''' - background-color: rgba(255, 255, 255, 0); - ''' - - groupBoxs = self.findChildren(QGroupBox) - for groupBox in groupBoxs: - groupBox.setStyleSheet(groupBox_common_css) - groupBox.setFont(font) - - if False: - # 统一设置下样式先 - common_css = "margin: 5px 0px; height: 40px;" - - # 无效设置 - font = QFont("微软雅黑", 14) # 创建一个字体对象 - font.setWeight(QFont.Bold) # 设置字体粗细 - - labels = self.findChildren(QLabel) - for label in labels: - label.setStyleSheet(common_css) - label.setFont(font) - - - comboBoxs = self.findChildren(QComboBox) - for comboBox in comboBoxs: - comboBox.setStyleSheet(common_css) - comboBox.setFont(font) - - lineEdits = self.findChildren(QLineEdit) - for lineEdit in lineEdits: - lineEdit.setStyleSheet(common_css) - lineEdit.setFont(font) - - textEdits = self.findChildren(QTextEdit) - for textEdit in textEdits: - textEdit.setStyleSheet(common_css) - textEdit.setFont(font) - - - self.show() - - # 将按钮点击事件与自定义的功能函数进行连接 - self.ui.pushButton_save.disconnect() - self.ui.pushButton_factory.disconnect() - self.ui.pushButton_run.disconnect() - self.ui.pushButton_config_page.disconnect() - self.ui.pushButton_run_page.disconnect() - self.ui.pushButton_copywriting_page.disconnect() - self.ui.pushButton_talk_page.disconnect() - self.ui.pushButton_integral_page.disconnect() - self.ui.pushButton_save.clicked.connect(self.on_pushButton_save_clicked) - self.ui.pushButton_factory.clicked.connect(self.on_pushButton_factory_clicked) - self.ui.pushButton_run.clicked.connect(self.on_pushButton_run_clicked) - self.ui.pushButton_config_page.clicked.connect(lambda: self.on_pushButton_change_page_clicked(0)) - self.ui.pushButton_run_page.clicked.connect(lambda: self.on_pushButton_change_page_clicked(1)) - self.ui.pushButton_copywriting_page.clicked.connect(lambda: self.on_pushButton_change_page_clicked(2)) - self.ui.pushButton_talk_page.clicked.connect(lambda: self.on_pushButton_change_page_clicked(3)) - self.ui.pushButton_integral_page.clicked.connect(lambda: self.on_pushButton_change_page_clicked(4)) - - - # 文案页 - self.ui.pushButton_copywriting_config_index_add.disconnect() - self.ui.pushButton_copywriting_config_index_del.disconnect() - self.ui.pushButton_copywriting_select.disconnect() - self.ui.pushButton_copywriting_refresh_list.disconnect() - self.ui.pushButton_copywriting_save.disconnect() - self.ui.pushButton_copywriting_synthetic_audio.disconnect() - self.ui.pushButton_copywriting_loop_play.disconnect() - self.ui.pushButton_copywriting_pause_play.disconnect() - self.ui.pushButton_copywriting_config_index_add.clicked.connect(self.on_pushButton_copywriting_config_index_add_clicked) - self.ui.pushButton_copywriting_config_index_del.clicked.connect(self.on_pushButton_copywriting_config_index_del_clicked) - self.ui.pushButton_copywriting_select.clicked.connect(self.on_pushButton_copywriting_select_clicked) - self.ui.pushButton_copywriting_refresh_list.clicked.connect(self.on_pushButton_copywriting_refresh_list_clicked) - self.ui.pushButton_copywriting_save.clicked.connect(self.on_pushButton_copywriting_save_clicked) - self.ui.pushButton_copywriting_synthetic_audio.clicked.connect(self.on_pushButton_copywriting_synthetic_audio_clicked) - self.ui.pushButton_copywriting_loop_play.clicked.connect(self.on_pushButton_copywriting_loop_play_clicked) - self.ui.pushButton_copywriting_pause_play.clicked.connect(self.on_pushButton_copywriting_pause_play_clicked) - - # 聊天页 - self.ui.pushButton_talk_chat_box_send.disconnect() - self.ui.pushButton_talk_chat_box_reread.disconnect() - self.ui.pushButton_talk_chat_box_send.clicked.connect(self.on_pushButton_talk_chat_box_send_clicked) - self.ui.pushButton_talk_chat_box_reread.clicked.connect(self.on_pushButton_talk_chat_box_reread_clicked) - - # 下拉框相关槽函数 - self.ui.comboBox_chat_type.disconnect() - self.ui.comboBox_audio_synthesis_type.disconnect() - self.ui.comboBox_talk_type.disconnect() - self.ui.comboBox_chat_type.currentIndexChanged.connect(lambda index: self.oncomboBox_chat_type_IndexChanged(index)) - self.ui.comboBox_audio_synthesis_type.currentIndexChanged.connect(lambda index: self.oncomboBox_audio_synthesis_type_IndexChanged(index)) - self.ui.comboBox_talk_type.currentIndexChanged.connect(lambda index: self.oncomboBox_talk_type_IndexChanged(index)) - - # 顶部餐单栏槽函数 - self.ui.action_official_store.triggered.connect(self.openBrowser_github) - self.ui.action_video_tutorials.triggered.connect(self.openBrowser_video) - self.ui.action_online_doc.triggered.connect(self.openBrowser_online_doc) - self.ui.action_about.triggered.connect(self.alert_about) - self.ui.action_exit.triggered.connect(self.exit_soft) - self.ui.action_official_qq_group.triggered.connect(self.openBrowser_official_qq_group) - - # 创建节流函数,并将其保存为类的属性,delay秒内只执行一次 - self.throttled_save = self.throttle(self.save, 1) - self.throttled_factory = self.throttle(self.factory, 1) - self.throttled_run = self.throttle(self.run, 1) - self.throttled_change_page = self.throttle(self.change_page, 0.5) - self.throttled_copywriting_config_index_add = self.throttle(self.copywriting_config_index_add, 1) - self.throttled_copywriting_config_index_del = self.throttle(self.copywriting_config_index_del, 1) - self.throttled_copywriting_select = self.throttle(self.copywriting_select, 1) - self.throttled_copywriting_refresh_list = self.throttle(self.copywriting_refresh_list, 1) - self.throttled_copywriting_save = self.throttle(self.copywriting_save, 1) - self.throttled_copywriting_synthetic_audio = self.throttle(self.copywriting_synthetic_audio, 1) - self.throttled_copywriting_loop_play = self.throttle(self.copywriting_loop_play, 1) - self.throttled_copywriting_pause_play = self.throttle(self.copywriting_pause_play, 1) - self.throttled_talk_chat_box_send = self.throttle(self.talk_chat_box_send, 0.5) - self.throttled_talk_chat_box_reread = self.throttle(self.talk_chat_box_reread, 0.5) - - - - ''' - 按钮相关的函数 - ''' - # 保存喵(开始堆shi喵) - def save(self): - global config, config_path - try: - with open(config_path, 'r', encoding="utf-8") as config_file: - config_data = json.load(config_file) - except Exception as e: - logging.error(f"无法写入配置文件!\n{e}") - self.show_message_box("错误", f"无法写入配置文件!\n{e}", QMessageBox.Critical) - return False - - def common_textEdit_handle(content): - """通用的textEdit 多行文本内容处理 - - Args: - content (str): 原始多行文本内容 - - Returns: - _type_: 处理好的多行文本内容 - """ - # 通用多行分隔符 - separators = [" ", "\n"] - - ret = [token.strip() for separator in separators for part in content.split(separator) if (token := part.strip())] - if 0 != len(ret): - ret = ret[1:] - - return ret - - - try: - # 获取下拉框当前选中的内容 - platform = self.ui.comboBox_platform.currentText() - if platform == "聊天模式": - config_data["platform"] = "talk" - elif platform == "哔哩哔哩": - config_data["platform"] = "bilibili" - elif platform == "抖音": - config_data["platform"] = "dy" - elif platform == "快手": - config_data["platform"] = "ks" - elif platform == "斗鱼": - config_data["platform"] = "douyu" - elif platform == "YouTube": - config_data["platform"] = "youtube" - elif platform == "twitch": - config_data["platform"] = "twitch" - elif platform == "哔哩哔哩2": - config_data["platform"] = "bilibili2" - - # 获取单行文本输入框的内容 - room_display_id = self.ui.lineEdit_room_display_id.text() - # 直播间号配置放宽 - # if False == self.is_alpha_numeric(room_display_id): - # logging.error("直播间号只由字母或数字组成,请勿输入错误内容") - # self.show_message_box("错误", "直播间号只由字母或数字组成,请勿输入错误内容", QMessageBox.Critical) - # return False - config_data["room_display_id"] = room_display_id - - # 新增LLM时,这块也需要适配,保存回配置文件 - chat_type = self.ui.comboBox_chat_type.currentText() - logging.info(f"chat_type={chat_type}") - if chat_type == "不启用": - config_data["chat_type"] = "none" - elif chat_type == "复读机": - config_data["chat_type"] = "reread" - elif chat_type == "ChatGPT/闻达": - config_data["chat_type"] = "chatgpt" - elif chat_type == "Claude": - config_data["chat_type"] = "claude" - elif chat_type == "Claude2": - config_data["chat_type"] = "claude2" - elif chat_type == "ChatGLM": - config_data["chat_type"] = "chatglm" - elif chat_type == "chat_with_file": - config_data["chat_type"] = "chat_with_file" - elif chat_type == "Chatterbot": - config_data["chat_type"] = "chatterbot" - elif chat_type == "text_generation_webui": - config_data["chat_type"] = "text_generation_webui" - elif chat_type == "讯飞星火": - config_data["chat_type"] = "sparkdesk" - elif chat_type == "langchain_chatglm": - config_data["chat_type"] = "langchain_chatglm" - elif chat_type == "智谱AI": - config_data["chat_type"] = "zhipu" - elif chat_type == "Bard": - config_data["chat_type"] = "bard" - elif chat_type == "文心一言": - config_data["chat_type"] = "yiyan" - elif chat_type == "通义千问": - config_data["chat_type"] = "tongyi" - - config_data["visual_body"] = self.ui.comboBox_visual_body.currentText() - - config_data["before_prompt"] = self.ui.lineEdit_before_prompt.text() - config_data["after_prompt"] = self.ui.lineEdit_after_prompt.text() - - # 本地问答 - config_data["read_user_name"]["enable"] = self.ui.checkBox_read_user_name_enable.isChecked() - config_data["read_user_name"]["voice_change"] = self.ui.checkBox_read_user_name_voice_change.isChecked() - config_data["read_user_name"]["reply_before"] = common_textEdit_handle(self.ui.textEdit_read_user_name_reply_before.toPlainText()) - config_data["read_user_name"]["reply_after"] = common_textEdit_handle(self.ui.textEdit_read_user_name_reply_after.toPlainText()) - - need_lang = self.ui.comboBox_need_lang.currentText() - if need_lang == "所有": - config_data["need_lang"] = "none" - elif need_lang == "中文": - config_data["need_lang"] = "zh" - elif need_lang == "英文": - config_data["need_lang"] = "en" - elif need_lang == "日文": - config_data["need_lang"] = "jp" - - config_data["comment_log_type"] = self.ui.comboBox_comment_log_type.currentText() - - # 日志 - config_data["captions"]["enable"] = self.ui.checkBox_captions_enable.isChecked() - config_data["captions"]["file_path"] = self.ui.lineEdit_captions_file_path.text() - - # 本地问答 - config_data["local_qa"]["text"]["enable"] = self.ui.checkBox_local_qa_text_enable.isChecked() - local_qa_text_type = self.ui.comboBox_local_qa_text_type.currentText() - if local_qa_text_type == "自定义json": - config_data["local_qa"]["text"]["type"] = "json" - elif local_qa_text_type == "一问一答": - config_data["local_qa"]["text"]["type"] = "text" - config_data["local_qa"]["text"]["file_path"] = self.ui.lineEdit_local_qa_text_file_path.text() - config_data["local_qa"]["text"]["similarity"] = round(float(self.ui.lineEdit_local_qa_text_similarity.text()), 2) - config_data["local_qa"]["audio"]["enable"] = self.ui.checkBox_local_qa_audio_enable.isChecked() - config_data["local_qa"]["audio"]["file_path"] = self.ui.lineEdit_local_qa_audio_file_path.text() - config_data["local_qa"]["audio"]["similarity"] = round(float(self.ui.lineEdit_local_qa_audio_similarity.text()), 2) - - # 过滤 - config_data["filter"]["before_must_str"] = common_textEdit_handle(self.ui.textEdit_filter_before_must_str.toPlainText()) - config_data["filter"]["after_must_str"] = common_textEdit_handle(self.ui.textEdit_filter_after_must_str.toPlainText()) - config_data["filter"]["badwords_path"] = self.ui.lineEdit_filter_badwords_path.text() - config_data["filter"]["bad_pinyin_path"] = self.ui.lineEdit_filter_bad_pinyin_path.text() - config_data["filter"]["max_len"] = int(self.ui.lineEdit_filter_max_len.text()) - config_data["filter"]["max_char_len"] = int(self.ui.lineEdit_filter_max_char_len.text()) - config_data["filter"]["comment_forget_duration"] = round(float(self.ui.lineEdit_filter_comment_forget_duration.text()), 2) - config_data["filter"]["comment_forget_reserve_num"] = int(self.ui.lineEdit_filter_comment_forget_reserve_num.text()) - config_data["filter"]["gift_forget_duration"] = round(float(self.ui.lineEdit_filter_gift_forget_duration.text()), 2) - config_data["filter"]["gift_forget_reserve_num"] = int(self.ui.lineEdit_filter_gift_forget_reserve_num.text()) - config_data["filter"]["entrance_forget_duration"] = round(float(self.ui.lineEdit_filter_entrance_forget_duration.text()), 2) - config_data["filter"]["entrance_forget_reserve_num"] = int(self.ui.lineEdit_filter_entrance_forget_reserve_num.text()) - config_data["filter"]["follow_forget_duration"] = round(float(self.ui.lineEdit_filter_follow_forget_duration.text()), 2) - config_data["filter"]["follow_forget_reserve_num"] = int(self.ui.lineEdit_filter_follow_forget_reserve_num.text()) - config_data["filter"]["talk_forget_duration"] = round(float(self.ui.lineEdit_filter_talk_forget_duration.text()), 2) - config_data["filter"]["talk_forget_reserve_num"] = int(self.ui.lineEdit_filter_talk_forget_reserve_num.text()) - config_data["filter"]["schedule_forget_duration"] = round(float(self.ui.lineEdit_filter_schedule_forget_duration.text()), 2) - config_data["filter"]["schedule_forget_reserve_num"] = int(self.ui.lineEdit_filter_schedule_forget_reserve_num.text()) - - # 答谢 - config_data["thanks"]["entrance_enable"] = self.ui.checkBox_thanks_entrance_enable.isChecked() - config_data["thanks"]["entrance_copy"] = self.ui.lineEdit_thanks_entrance_copy.text() - config_data["thanks"]["gift_enable"] = self.ui.checkBox_thanks_gift_enable.isChecked() - config_data["thanks"]["gift_copy"] = self.ui.lineEdit_thanks_gift_copy.text() - config_data["thanks"]["lowest_price"] = round(float(self.ui.lineEdit_thanks_lowest_price.text()), 2) - config_data["thanks"]["follow_enable"] = self.ui.checkBox_thanks_follow_enable.isChecked() - config_data["thanks"]["follow_copy"] = self.ui.lineEdit_thanks_follow_copy.text() - - config_data["live2d"]["enable"] = self.ui.checkBox_live2d_enable.isChecked() - live2d_port = self.ui.lineEdit_live2d_port.text() - config_data["live2d"]["port"] = int(live2d_port) - tmp_str = f"var model_name = \"{self.ui.comboBox_live2d_name.currentText()}\";" - common.write_content_to_file("Live2D/js/model_name.js", tmp_str) - - openai_api = self.ui.lineEdit_openai_api.text() - config_data["openai"]["api"] = openai_api - # 获取多行文本输入框的内容 - config_data["openai"]["api_key"] = common_textEdit_handle(self.ui.textEdit_openai_api_key.toPlainText()) - - config_data["chatgpt"]["model"] = self.ui.comboBox_chatgpt_model.currentText() - config_data["chatgpt"]["temperature"] = round(float(self.ui.lineEdit_chatgpt_temperature.text()), 1) - config_data["chatgpt"]["max_tokens"] = int(self.ui.lineEdit_chatgpt_max_tokens.text()) - config_data["chatgpt"]["top_p"] = round(float(self.ui.lineEdit_chatgpt_top_p.text()), 1) - config_data["chatgpt"]["presence_penalty"] = round(float(self.ui.lineEdit_chatgpt_presence_penalty.text()), 1) - config_data["chatgpt"]["frequency_penalty"] = round(float(self.ui.lineEdit_chatgpt_frequency_penalty.text()), 1) - config_data["chatgpt"]["preset"] = self.ui.lineEdit_chatgpt_preset.text() - - chatterbot_name = self.ui.lineEdit_chatterbot_name.text() - config_data["chatterbot"]["name"] = chatterbot_name - chatterbot_db_path = self.ui.lineEdit_chatterbot_db_path.text() - config_data["chatterbot"]["db_path"] = chatterbot_db_path - - config_data["claude"]["slack_user_token"] = self.ui.lineEdit_claude_slack_user_token.text() - config_data["claude"]["bot_user_id"] = self.ui.lineEdit_claude_bot_user_id.text() - - config_data["claude2"]["cookie"] = self.ui.lineEdit_claude2_cookie.text() - config_data["claude2"]["use_proxy"] = self.ui.checkBox_claude2_use_proxy.isChecked() - config_data["claude2"]["proxies"]["http"] = self.ui.lineEdit_claude2_proxies_http.text() - config_data["claude2"]["proxies"]["https"] = self.ui.lineEdit_claude2_proxies_https.text() - config_data["claude2"]["proxies"]["socks5"] = self.ui.lineEdit_claude2_proxies_socks5.text() - - config_data["chatglm"]["api_ip_port"] = self.ui.lineEdit_chatglm_api_ip_port.text() - config_data["chatglm"]["max_length"] = int(self.ui.lineEdit_chatglm_max_length.text()) - config_data["chatglm"]["top_p"] = round(float(self.ui.lineEdit_chatglm_top_p.text()), 1) - config_data["chatglm"]["temperature"] = round(float(self.ui.lineEdit_chatglm_temperature.text()), 2) - config_data["chatglm"]["history_enable"] = self.ui.checkBox_chatglm_history_enable.isChecked() - config_data["chatglm"]["history_max_len"] = int(self.ui.lineEdit_chatglm_history_max_len.text()) - - config_data["langchain_chatglm"]["api_ip_port"] = self.ui.lineEdit_langchain_chatglm_api_ip_port.text() - config_data["langchain_chatglm"]["chat_type"] = self.ui.comboBox_langchain_chatglm_chat_type.currentText() - config_data["langchain_chatglm"]["knowledge_base_id"] = self.ui.lineEdit_langchain_chatglm_knowledge_base_id.text() - config_data["langchain_chatglm"]["history_enable"] = self.ui.checkBox_langchain_chatglm_history_enable.isChecked() - config_data["langchain_chatglm"]["history_max_len"] = int(self.ui.lineEdit_langchain_chatglm_history_max_len.text()) - - config_data["chat_with_file"]["chat_mode"] = self.ui.comboBox_chat_with_file_chat_mode.currentText() - chat_with_file_data_path = self.ui.lineEdit_chat_with_file_data_path.text() - config_data["chat_with_file"]["data_path"] = chat_with_file_data_path - chat_with_file_separator = self.ui.lineEdit_chat_with_file_separator.text() - config_data["chat_with_file"]["separator"] = chat_with_file_separator - chat_with_file_chunk_size = self.ui.lineEdit_chat_with_file_chunk_size.text() - config_data["chat_with_file"]["chunk_size"] = int(chat_with_file_chunk_size) - chat_with_file_chunk_overlap = self.ui.lineEdit_chat_with_file_chunk_overlap.text() - config_data["chat_with_file"]["chunk_overlap"] = int(chat_with_file_chunk_overlap) - config_data["chat_with_file"]["local_vector_embedding_model"] = self.ui.comboBox_chat_with_file_local_vector_embedding_model.currentText() - chat_with_file_chain_type = self.ui.lineEdit_chat_with_file_chain_type.text() - config_data["chat_with_file"]["chain_type"] = chat_with_file_chain_type - # 获取复选框的选中状态 - chat_with_file_show_token_cost = self.ui.checkBox_chat_with_file_show_token_cost.isChecked() - config_data["chat_with_file"]["show_token_cost"] = chat_with_file_show_token_cost - chat_with_file_question_prompt = self.ui.lineEdit_chat_with_file_question_prompt.text() - config_data["chat_with_file"]["question_prompt"] = chat_with_file_question_prompt - chat_with_file_local_max_query = self.ui.lineEdit_chat_with_file_local_max_query.text() - config_data["chat_with_file"]["local_max_query"] = int(chat_with_file_local_max_query) - - config_data["text_generation_webui"]["api_ip_port"] = self.ui.lineEdit_text_generation_webui_api_ip_port.text() - config_data["text_generation_webui"]["max_new_tokens"] = int(self.ui.lineEdit_text_generation_webui_max_new_tokens.text()) - config_data["text_generation_webui"]["mode"] = self.ui.lineEdit_text_generation_webui_mode.text() - config_data["text_generation_webui"]["character"] = self.ui.lineEdit_text_generation_webui_character.text() - config_data["text_generation_webui"]["instruction_template"] = self.ui.lineEdit_text_generation_webui_instruction_template.text() - config_data["text_generation_webui"]["your_name"] = self.ui.lineEdit_text_generation_webui_your_name.text() - - # sparkdesk - config_data["sparkdesk"]["type"] = self.ui.comboBox_sparkdesk_type.currentText() - config_data["sparkdesk"]["cookie"] = self.ui.lineEdit_sparkdesk_cookie.text() - config_data["sparkdesk"]["fd"] = self.ui.lineEdit_sparkdesk_fd.text() - config_data["sparkdesk"]["GtToken"] = self.ui.lineEdit_sparkdesk_GtToken.text() - config_data["sparkdesk"]["app_id"] = self.ui.lineEdit_sparkdesk_app_id.text() - config_data["sparkdesk"]["api_secret"] = self.ui.lineEdit_sparkdesk_api_secret.text() - config_data["sparkdesk"]["api_key"] = self.ui.lineEdit_sparkdesk_api_key.text() - config_data["sparkdesk"]["version"] = round(float(self.ui.comboBox_sparkdesk_version.currentText()), 1) - - audio_synthesis_type = self.ui.comboBox_audio_synthesis_type.currentText() - if audio_synthesis_type == "Edge-TTS": - config_data["audio_synthesis_type"] = "edge-tts" - elif audio_synthesis_type == "VITS": - config_data["audio_synthesis_type"] = "vits" - elif audio_synthesis_type == "VITS-Fast": - config_data["audio_synthesis_type"] = "vits_fast" - elif audio_synthesis_type == "elevenlabs": - config_data["audio_synthesis_type"] = "elevenlabs" - elif audio_synthesis_type == "genshinvoice_top": - config_data["audio_synthesis_type"] = "genshinvoice_top" - elif audio_synthesis_type == "bark_gui": - config_data["audio_synthesis_type"] = "bark_gui" - elif audio_synthesis_type == "VALL-E-X": - config_data["audio_synthesis_type"] = "vall_e_x" - elif audio_synthesis_type == "OpenAI TTS": - config_data["audio_synthesis_type"] = "openai_tts" - - # 音频随机变速 - config_data["audio_random_speed"]["normal"]["enable"] = self.ui.checkBox_audio_random_speed_normal_enable.isChecked() - config_data["audio_random_speed"]["normal"]["speed_min"] = round(float(self.ui.lineEdit_audio_random_speed_normal_speed_min.text()), 2) - config_data["audio_random_speed"]["normal"]["speed_max"] = round(float(self.ui.lineEdit_audio_random_speed_normal_speed_max.text()), 2) - config_data["audio_random_speed"]["copywriting"]["enable"] = self.ui.checkBox_audio_random_speed_copywriting_enable.isChecked() - config_data["audio_random_speed"]["copywriting"]["speed_min"] = round(float(self.ui.lineEdit_audio_random_speed_copywriting_speed_min.text()), 2) - config_data["audio_random_speed"]["copywriting"]["speed_max"] = round(float(self.ui.lineEdit_audio_random_speed_copywriting_speed_max.text()), 2) - - config_data["vits_fast"]["config_path"] = self.ui.lineEdit_vits_fast_config_path.text() - config_data["vits_fast"]["api_ip_port"] = self.ui.lineEdit_vits_fast_api_ip_port.text() - config_data["vits_fast"]["character"] = self.ui.lineEdit_vits_fast_character.text() - config_data["vits_fast"]["language"] = self.ui.comboBox_vits_fast_language.currentText() - config_data["vits_fast"]["speed"] = round(float(self.ui.lineEdit_vits_fast_speed.text()), 1) - - config_data["edge-tts"]["voice"] = self.ui.comboBox_edge_tts_voice.currentText() - config_data["edge-tts"]["rate"] = self.ui.lineEdit_edge_tts_rate.text() - config_data["edge-tts"]["volume"] = self.ui.lineEdit_edge_tts_volume.text() - - config_data["elevenlabs"]["api_key"] = self.ui.lineEdit_elevenlabs_api_key.text() - config_data["elevenlabs"]["voice"] = self.ui.lineEdit_elevenlabs_voice.text() - config_data["elevenlabs"]["model"] = self.ui.lineEdit_elevenlabs_model.text() - - config_data["genshinvoice_top"]["speaker"] = self.ui.comboBox_genshinvoice_top_speaker.currentText() - config_data["genshinvoice_top"]["noise"] = self.ui.lineEdit_genshinvoice_top_noise.text() - config_data["genshinvoice_top"]["noisew"] = self.ui.lineEdit_genshinvoice_top_noisew.text() - config_data["genshinvoice_top"]["length"] = self.ui.lineEdit_genshinvoice_top_length.text() - config_data["genshinvoice_top"]["format"] = self.ui.lineEdit_genshinvoice_top_format.text() - config_data["genshinvoice_top"]["language"] = self.ui.comboBox_genshinvoice_top_language.currentText() - - # bark-gui - config_data["bark_gui"]["api_ip_port"] = self.ui.lineEdit_bark_gui_api_ip_port.text() - config_data["bark_gui"]["spk"] = self.ui.lineEdit_bark_gui_spk.text() - config_data["bark_gui"]["generation_temperature"] = round(float(self.ui.lineEdit_bark_gui_generation_temperature.text()), 1) - config_data["bark_gui"]["waveform_temperature"] = round(float(self.ui.lineEdit_bark_gui_waveform_temperature.text()), 1) - config_data["bark_gui"]["end_of_sentence_probability"] = round(float(self.ui.lineEdit_bark_gui_end_of_sentence_probability.text()), 2) - config_data["bark_gui"]["quick_generation"] = self.ui.checkBox_bark_gui_quick_generation.isChecked() - config_data["bark_gui"]["seed"] = round(float(self.ui.lineEdit_bark_gui_seed.text()), 2) - config_data["bark_gui"]["batch_count"] = int(self.ui.lineEdit_bark_gui_batch_count.text()) - - # 点歌 - config_data["choose_song"]["enable"] = self.ui.checkBox_choose_song_enable.isChecked() - config_data["choose_song"]["start_cmd"] = self.ui.lineEdit_choose_song_start_cmd.text() - config_data["choose_song"]["stop_cmd"] = self.ui.lineEdit_choose_song_stop_cmd.text() - config_data["choose_song"]["random_cmd"] = self.ui.lineEdit_choose_song_random_cmd.text() - config_data["choose_song"]["song_path"] = self.ui.lineEdit_choose_song_song_path.text() - config_data["choose_song"]["match_fail_copy"] = self.ui.lineEdit_choose_song_match_fail_copy.text() - - # DDSP-SVC - config_data["ddsp_svc"]["enable"] = self.ui.checkBox_ddsp_svc_enable.isChecked() - config_data["ddsp_svc"]["config_path"] = self.ui.lineEdit_ddsp_svc_config_path.text() - config_data["ddsp_svc"]["api_ip_port"] = self.ui.lineEdit_ddsp_svc_api_ip_port.text() - config_data["ddsp_svc"]["fSafePrefixPadLength"] = round(float(self.ui.lineEdit_ddsp_svc_fSafePrefixPadLength.text()), 1) - config_data["ddsp_svc"]["fPitchChange"] = round(float(self.ui.lineEdit_ddsp_svc_fPitchChange.text()), 1) - config_data["ddsp_svc"]["sSpeakId"] = int(self.ui.lineEdit_ddsp_svc_sSpeakId.text()) - config_data["ddsp_svc"]["sampleRate"] = int(self.ui.lineEdit_ddsp_svc_sampleRate.text()) - - # so-vits-svc - config_data["so_vits_svc"]["enable"] = self.ui.checkBox_so_vits_svc_enable.isChecked() - config_data["so_vits_svc"]["config_path"] = self.ui.lineEdit_so_vits_svc_config_path.text() - config_data["so_vits_svc"]["api_ip_port"] = self.ui.lineEdit_so_vits_svc_api_ip_port.text() - config_data["so_vits_svc"]["spk"] = self.ui.lineEdit_so_vits_svc_spk.text() - config_data["so_vits_svc"]["tran"] = round(float(self.ui.lineEdit_so_vits_svc_tran.text()), 1) - config_data["so_vits_svc"]["wav_format"] = self.ui.lineEdit_so_vits_svc_wav_format.text() - - # SD - config_data["sd"]["enable"] = self.ui.checkBox_sd_enable.isChecked() - config_data["sd"]["prompt_llm"]["type"] = self.ui.comboBox_prompt_llm_type.currentText() - config_data["sd"]["prompt_llm"]["before_prompt"] = self.ui.lineEdit_prompt_llm_before_prompt.text() - config_data["sd"]["prompt_llm"]["after_prompt"] = self.ui.lineEdit_prompt_llm_after_prompt.text() - config_data["sd"]["trigger"] = self.ui.lineEdit_sd_trigger.text() - config_data["sd"]["ip"] = self.ui.lineEdit_sd_ip.text() - sd_port = self.ui.lineEdit_sd_port.text() - # logging.info(f"sd_port={sd_port}") - config_data["sd"]["port"] = int(sd_port) - config_data["sd"]["negative_prompt"] = self.ui.lineEdit_sd_negative_prompt.text() - config_data["sd"]["seed"] = float(self.ui.lineEdit_sd_seed.text()) - # 获取多行文本输入框的内容 - config_data["sd"]["styles"] = common_textEdit_handle(self.ui.textEdit_sd_styles.toPlainText()) - config_data["sd"]["cfg_scale"] = int(self.ui.lineEdit_sd_cfg_scale.text()) - config_data["sd"]["steps"] = int(self.ui.lineEdit_sd_steps.text()) - config_data["sd"]["hr_resize_x"] = int(self.ui.lineEdit_sd_hr_resize_x.text()) - config_data["sd"]["hr_resize_y"] = int(self.ui.lineEdit_sd_hr_resize_y.text()) - config_data["sd"]["enable_hr"] = self.ui.checkBox_sd_enable_hr.isChecked() - config_data["sd"]["hr_scale"] = int(self.ui.lineEdit_sd_hr_scale.text()) - config_data["sd"]["hr_second_pass_steps"] = int(self.ui.lineEdit_sd_hr_second_pass_steps.text()) - config_data["sd"]["denoising_strength"] = round(float(self.ui.lineEdit_sd_denoising_strength.text()), 1) - - config_data["header"]["userAgent"] = self.ui.lineEdit_header_useragent.text() - - # 聊天 - config_data["talk"]["username"] = self.ui.lineEdit_talk_username.text() - config_data["talk"]["continuous_talk"] = self.ui.checkBox_talk_continuous_talk.isChecked() - config_data["talk"]["trigger_key"] = self.ui.comboBox_talk_trigger_key.currentText() - config_data["talk"]["stop_trigger_key"] = self.ui.comboBox_talk_stop_trigger_key.currentText() - config_data["talk"]["type"] = self.ui.comboBox_talk_type.currentText() - config_data["talk"]["volume_threshold"] = round(float(self.ui.lineEdit_talk_volume_threshold.text()), 1) - config_data["talk"]["silence_threshold"] = round(float(self.ui.lineEdit_talk_silence_threshold.text()), 1) - config_data["talk"]["baidu"]["app_id"] = self.ui.lineEdit_talk_baidu_app_id.text() - config_data["talk"]["baidu"]["api_key"] = self.ui.lineEdit_talk_baidu_api_key.text() - config_data["talk"]["baidu"]["secret_key"] = self.ui.lineEdit_talk_baidu_secret_key.text() - config_data["talk"]["google"]["tgt_lang"] = self.ui.comboBox_talk_google_tgt_lang.currentText() - - schedule_data = self.update_data_from_gridLayout(self.ui.gridLayout_schedule) - - """ - 动态读取GUI内数据到配置变量 - """ - # 通用的函数用于将GridLayout数据重组为JSON格式列表 - def reorganize_grid_data_list(grid_data, keys_per_item): - tmp_json = [] - keys = list(grid_data.keys()) - - for i in range(0, len(keys), len(keys_per_item)): - item = {} - for j, key in enumerate(keys_per_item): - item[key] = grid_data[keys[i + j]] - tmp_json.append(item) - - logging.debug(f"tmp_json={tmp_json}") - return tmp_json - - # 通用的函数用于将GridLayout数据重组为JSON格式 - def reorganize_grid_data(grid_data, keys_mapping): - keys = list(grid_data.keys()) - tmp_json = {new_key: grid_data[keys[old_key]] for new_key, old_key in keys_mapping.items()} - logging.debug(f"tmp_json={tmp_json}") - return tmp_json - - def reorganize_schedule_data(schedule_data): - tmp_json = [] - keys = list(schedule_data.keys()) - - for i in range(0, len(keys), 3): - item = {} - - key_checkbox = keys[i] - key_lineedit = keys[i + 1] - key_textedit = keys[i + 2] - - item["enable"] = schedule_data[key_checkbox] - - time_value = schedule_data[key_lineedit] - try: - item["time"] = float(time_value) - except ValueError: - item["time"] = 1.0 - - # 对于文本列表,确保处理成字符串列表类型 - copy_list = schedule_data[key_textedit] - if isinstance(copy_list, list): - item["copy"] = [str(item) for item in copy_list if isinstance(item, str)] - else: - item["copy"] = [] - - tmp_json.append(item) - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - # 写回json - config_data["schedule"] = reorganize_schedule_data(schedule_data) - # logging.info(config_data) - - # 文案 - copywriting_config_data = self.update_data_from_gridLayout(self.ui.gridLayout_copywriting_config) - - def reorganize_copywriting_config_data(copywriting_config_data): - tmp_json = [] - keys = list(copywriting_config_data.keys()) - - for i in range(0, len(keys), 7): - item = {} - - key_file_path = keys[i] - key_audio_path = keys[i + 1] - # 跳过1个 - key_play_list = keys[i + 2 + 1] - # 跳过1个 - key_continuous_play_num = keys[i + 3 + 2] - key_max_play_time = keys[i + 4 + 2] - - item["file_path"] = copywriting_config_data[key_file_path] - item["audio_path"] = copywriting_config_data[key_audio_path] - - # 对于文本列表,确保处理成字符串列表类型 - play_list = copywriting_config_data[key_play_list] - if isinstance(play_list, list): - item["play_list"] = [str(item) for item in play_list if isinstance(item, str)] - else: - item["play_list"] = [] - - try: - item["continuous_play_num"] = int(copywriting_config_data[key_continuous_play_num]) - except ValueError: - item["continuous_play_num"] = 1 - - max_play_time = copywriting_config_data[key_max_play_time] - try: - item["max_play_time"] = round(float(max_play_time), 2) - except ValueError: - item["max_play_time"] = 1.0 - - tmp_json.append(item) - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - config_data["copywriting"]["config"] = reorganize_copywriting_config_data(copywriting_config_data) - config_data["copywriting"]["audio_interval"] = round(float(self.ui.lineEdit_copywriting_audio_interval.text()), 1) - config_data["copywriting"]["switching_interval"] = round(float(self.ui.lineEdit_copywriting_switching_interval.text()), 1) - config_data["copywriting"]["auto_play"] = self.ui.checkBox_copywriting_switching_auto_play.isChecked() - config_data["copywriting"]["random_play"] = self.ui.checkBox_copywriting_switching_random_play.isChecked() - - - # 定义每个GridLayout的键映射 - zhipu_keys_mapping = { - "api_key": 0, - "model": 1, - "top_p": 2, - "temperature": 3, - "history_enable": 4, - "history_max_len": 5, - "user_info": 6, - "bot_info": 7, - "bot_name": 8, - "user_name": 9, - "remove_useless": 10 - } - - # 重组zhipu数据并写回json - zhipu_data = self.update_data_from_gridLayout(self.ui.gridLayout_zhipu) - config_data["zhipu"] = reorganize_grid_data(zhipu_data, zhipu_keys_mapping) - - # 动态文案 - config_data["trends_copywriting"]["enable"] = self.ui.checkBox_trends_copywriting_enable.isChecked() - config_data["trends_copywriting"]["random_play"] = self.ui.checkBox_trends_copywriting_random_play.isChecked() - config_data["trends_copywriting"]["play_interval"] = int(self.ui.lineEdit_trends_copywriting_play_interval.text()) - - # 定义trends_copywriting GridLayout的键映射 - trends_copywriting_keys_per_item = ["folder_path", "prompt_change_enable", "prompt_change_content"] - # 重组trends_copywriting数据并写回json - trends_copywriting_data = self.update_data_from_gridLayout(self.ui.gridLayout_trends_copywriting_2) - config_data["trends_copywriting"]["copywriting"] = reorganize_grid_data_list(trends_copywriting_data, trends_copywriting_keys_per_item) - - # 闲时文案 - idle_time_task_keys_mapping = { - "enable": 0, - "idle_time": 1, - "random_time": 2 - } - - # 重组idle_time_task数据并写回json - idle_time_task_data = self.update_data_from_gridLayout(self.ui.gridLayout_idle_time_task) - config_data["idle_time_task"] = reorganize_grid_data(idle_time_task_data, idle_time_task_keys_mapping) - - idle_time_task_comment_keys_mapping = { - "enable": 0, - "random": 1, - "copy": 2 - } - - # 重组idle_time_task_comment数据并写回json - idle_time_task_comment_data = self.update_data_from_gridLayout(self.ui.gridLayout_idle_time_task_comment) - config_data["idle_time_task"]["comment"] = reorganize_grid_data(idle_time_task_comment_data, idle_time_task_comment_keys_mapping) - - idle_time_task_local_audio_keys_mapping = { - "enable": 0, - "random": 1, - "path": 2 - } - - # 重组idle_time_task_local_audio数据并写回json - idle_time_task_local_audio_data = self.update_data_from_gridLayout(self.ui.gridLayout_idle_time_task_local_audio) - config_data["idle_time_task"]["local_audio"] = reorganize_grid_data(idle_time_task_local_audio_data, idle_time_task_local_audio_keys_mapping) - - vits_keys_mapping = { - "type": 0, - "config_path": 1, - "api_ip_port": 2, - "id": 3, - "lang": 4, - "length": 5, - "noise": 6, - "noisew": 7, - "max": 8, - "format": 9, - "sdp_radio": 10, - } - - # 重组vits数据并写回json - vits_data = self.update_data_from_gridLayout(self.ui.gridLayout_vits) - config_data["vits"] = reorganize_grid_data(vits_data, vits_keys_mapping) - - database_keys_mapping = { - "path": 0, - "comment_enable": 1, - "entrance_enable": 2, - "gift_enable": 3 - } - - # 重组database数据并写回json - database_data = self.update_data_from_gridLayout(self.ui.gridLayout_database) - config_data["database"] = reorganize_grid_data(database_data, database_keys_mapping) - - play_audio_keys_mapping = { - "enable": 0, - "out_path": 1, - "player": 2 - } - - # 重组play_audio数据并写回json - play_audio_data = self.update_data_from_gridLayout(self.ui.gridLayout_play_audio) - config_data["play_audio"] = reorganize_grid_data(play_audio_data, play_audio_keys_mapping) - - audio_player_keys_mapping = { - "api_ip_port": 0 - # "type": 2 # 如果不需要该字段,可以注释掉或删除 - } - - # 重组audio_player数据并写回json - audio_player_data = self.update_data_from_gridLayout(self.ui.gridLayout_audio_player) - config_data["audio_player"] = reorganize_grid_data(audio_player_data, audio_player_keys_mapping) - - web_captions_printer_keys_mapping = { - "enable": 0, - "api_ip_port": 1 - # "type": 2 # 如果不需要该字段,可以注释掉或删除 - } - - # 重组web_captions_printer数据并写回json - web_captions_printer_data = self.update_data_from_gridLayout(self.ui.gridLayout_web_captions_printer) - config_data["web_captions_printer"] = reorganize_grid_data(web_captions_printer_data, web_captions_printer_keys_mapping) - - vall_e_x_keys_mapping = { - "api_ip_port": 0, - "language": 1, - "accent": 2, - "voice_preset": 3, - "voice_preset_file_path": 4 - } - - # 重组bilibili数据并写回json - vall_e_x_data = self.update_data_from_gridLayout(self.ui.gridLayout_vall_e_x) - config_data["vall_e_x"] = reorganize_grid_data(vall_e_x_data, vall_e_x_keys_mapping) - - openai_tts_keys_mapping = { - "type": 0, - "api_ip_port": 1, - "model": 2, - "voice": 3, - "api_key": 4 - } - - # 重组openai_tts数据并写回json - openai_tts_data = self.update_data_from_gridLayout(self.ui.gridLayout_openai_tts) - config_data["openai_tts"] = reorganize_grid_data(openai_tts_data, openai_tts_keys_mapping) - - bilibili_keys_mapping = { - "login_type": 0, - "cookie": 1, - "ac_time_value": 2, - "username": 3, - "password": 4 - } - - # 重组bilibili数据并写回json - bilibili_data = self.update_data_from_gridLayout(self.ui.gridLayout_bilibili) - config_data["bilibili"] = reorganize_grid_data(bilibili_data, bilibili_keys_mapping) - - twitch_keys_mapping = { - "token": 0, - "user": 1, - "proxy_server": 2, - "proxy_port": 3 - } - - # 重组twitch数据并写回json - twitch_data = self.update_data_from_gridLayout(self.ui.gridLayout_twitch) - config_data["twitch"] = reorganize_grid_data(twitch_data, twitch_keys_mapping) - - - bard_keys_mapping = { - "token": 0 - } - - # 重组bard数据并写回json - bard_data = self.update_data_from_gridLayout(self.ui.gridLayout_bard) - config_data["bard"] = reorganize_grid_data(bard_data, bard_keys_mapping) - - # 文心一言 - yiyan_keys_mapping = { - "api_ip_port": 0, - "type": 1, - "cookie": 2 - } - - # 重组yiyan数据并写回json - yiyan_data = self.update_data_from_gridLayout(self.ui.gridLayout_yiyan) - config_data["yiyan"] = reorganize_grid_data(yiyan_data, yiyan_keys_mapping) - - # 通义千问 - tongyi_keys_mapping = { - "type": 0, - "cookie_path": 1 - } - - tongyi_data = self.update_data_from_gridLayout(self.ui.gridLayout_tongyi) - config_data["tongyi"] = reorganize_grid_data(tongyi_data, tongyi_keys_mapping) - - # 念弹幕 - read_comment_keys_mapping = { - "enable": 0, - "read_username_enable": 1, - "voice_change": 2, - "read_username_copywriting": 3 - } - - # 重组read_comment数据并写回json - read_comment_data = self.update_data_from_gridLayout(self.ui.gridLayout_read_comment) - config_data["read_comment"] = reorganize_grid_data(read_comment_data, read_comment_keys_mapping) - - # 按键映射 - config_data["key_mapping"]["enable"] = self.ui.checkBox_key_mapping_enable.isChecked() - config_data["key_mapping"]["type"] = self.ui.comboBox_key_mapping_type.currentText() - config_data["key_mapping"]["start_cmd"] = self.ui.lineEdit_key_mapping_start_cmd.text() - - key_mapping_config_keys_per_item = ["keywords", "keys", "similarity"] - - # 重组key_mapping_config数据并写回json - key_mapping_config_data = self.update_data_from_gridLayout(self.ui.gridLayout_key_mapping_config) - config_data["key_mapping"]["config"] = reorganize_grid_data_list(key_mapping_config_data, key_mapping_config_keys_per_item) - - """ - 积分页 - """ - config_data["integral"]["enable"] = self.ui.checkBox_integral_common_enable.isChecked() - - # 入场 - def reorganize_integral_entrance_data(integral_entrance_data): - keys = list(integral_entrance_data.keys()) - - tmp_json = { - "enable": integral_entrance_data[keys[0]], - "get_integral": int(integral_entrance_data[keys[1]]), - "copywriting": [] - } - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - integral_entrance_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_entrance) - # 写回json - config_data["integral"]["entrance"] = reorganize_integral_entrance_data(integral_entrance_data) - - # 入场-文案 - # 定义 GridLayout的键映射 - integral_entrance_copywriting_keys_per_item = ["entrance_num_interval", "copywriting"] - - # 重组 数据并写回json - integral_entrance_copywriting_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_entrance_copywriting) - config_data["integral"]["entrance"]["copywriting"] = reorganize_grid_data_list(integral_entrance_copywriting_data, integral_entrance_copywriting_keys_per_item) - - # 签到 - def reorganize_integral_sign_data(integral_sign_data): - keys = list(integral_sign_data.keys()) - - tmp_json = { - "enable": integral_sign_data[keys[0]], - "cmd": integral_sign_data[keys[1]], - "get_integral": int(integral_sign_data[keys[2]]), - "copywriting": [] - } - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - integral_sign_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_sign) - # 写回json - config_data["integral"]["sign"] = reorganize_integral_sign_data(integral_sign_data) - - # 签到-文案 - # 定义integral_sign_copywriting GridLayout的键映射 - integral_sign_copywriting_keys_per_item = ["sign_num_interval", "copywriting"] - - # 重组integral_sign_copywriting数据并写回json - integral_sign_copywriting_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_sign_copywriting) - config_data["integral"]["sign"]["copywriting"] = reorganize_grid_data_list(integral_sign_copywriting_data, integral_sign_copywriting_keys_per_item) - - # 礼物 - def reorganize_integral_gift_data(integral_gift_data): - keys = list(integral_gift_data.keys()) - - tmp_json = { - "enable": integral_gift_data[keys[0]], - "get_integral_proportion": float(integral_gift_data[keys[1]]), - "copywriting": [] - } - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - integral_gift_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_gift) - # 写回json - config_data["integral"]["gift"] = reorganize_integral_gift_data(integral_gift_data) - - # 礼物-文案 - # 定义 GridLayout的键映射 - integral_gift_copywriting_keys_per_item = ["gift_price_interval", "copywriting"] - - # 重组 数据并写回json - integral_gift_copywriting_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_gift_copywriting) - config_data["integral"]["gift"]["copywriting"] = reorganize_grid_data_list(integral_gift_copywriting_data, integral_gift_copywriting_keys_per_item) - - # 增删查改 - def reorganize_integral_crud_query_data(integral_crud_query_data): - keys = list(integral_crud_query_data.keys()) - - tmp_json = { - "enable": integral_crud_query_data[keys[0]], - "cmd": integral_crud_query_data[keys[1]], - "copywriting": integral_crud_query_data[keys[2]] - } - - logging.debug(f"tmp_json={tmp_json}") - - return tmp_json - - integral_crud_query_data = self.update_data_from_gridLayout(self.ui.gridLayout_integral_crud_query) - # 写回json - config_data["integral"]["crud"]["query"] = reorganize_integral_crud_query_data(integral_crud_query_data) - - xuniren_keys_mapping = { - "api_ip_port": 0 - # "type": 2 # 如果不需要该字段,可以注释掉或删除 - } - - xuniren_data = self.update_data_from_gridLayout(self.ui.gridLayout_xuniren) - config_data["xuniren"] = reorganize_grid_data(xuniren_data, xuniren_keys_mapping) - - unity_keys_mapping = { - #"enable": 0, - "api_ip_port": 0 - # "type": 2 # 如果不需要该字段,可以注释掉或删除 - } - - unity_data = self.update_data_from_gridLayout(self.ui.gridLayout_unity) - config_data["unity"] = reorganize_grid_data(unity_data, unity_keys_mapping) - - """ - ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ - ------------------------------------------------------------------------------------------------------------- - """ - - # 获取自定义板块显隐的数据 - show_box_data = self.update_data_from_gridLayout(self.ui.gridLayout_show_box, "show_box") - show_box_json = {} - for key, value in show_box_data.items(): - checkbox_name = key.split('_QCheckBox')[0] - show_box_json[checkbox_name] = value - - logging.debug(show_box_json) - config_data["show_box"] = show_box_json - - except Exception as e: - logging.error(traceback.format_exc()) - self.show_message_box("错误", f"配置项格式有误,请检查配置!\n{e}", QMessageBox.Critical) - return False - - try: - with open(config_path, 'w', encoding="utf-8") as config_file: - json.dump(config_data, config_file, indent=2, ensure_ascii=False) - config_file.flush() # 刷新缓冲区,确保写入立即生效 - - logging.info("配置数据已成功写入文件!程序将在3秒后重启~") - self.show_message_box("提示", "配置数据已成功写入文件!程序将在3秒后重启~", QMessageBox.Information, 3000) - - self.restart_application() - - return True - except Exception as e: - logging.error(traceback.format_exc()) - logging.error(f"无法写入配置文件!\n{e}") - self.show_message_box("错误", f"无法写入配置文件!\n{e}", QMessageBox.Critical) - return False - - - ''' - 按钮相关的函数 - ''' - - # 恢复出厂配置 - def factory(self): - result = QMessageBox.question( - None, "确认框", "您确定要恢复出厂配置吗?", QMessageBox.Yes | QMessageBox.No - ) - if result == QMessageBox.No: - return - - source_file = 'config.json.bak' - destination_file = 'config.json' - - try: - with open(source_file, 'r', encoding="utf-8") as source: - with open(destination_file, 'w', encoding="utf-8") as destination: - destination.write(source.read()) - logging.info("恢复出厂配置成功!") - except Exception as e: - logging.error(f"恢复出厂配置失败!\n{e}") - self.show_message_box("错误", f"恢复出厂配置失败!\n{e}", QMessageBox.Critical) - - # 重载下配置 - self.init_config() - - - # 运行 - def run(self): - if self.running_flag == 1: - self.show_message_box("提醒", "程序运行中,请勿重复运行,请耐心等待喵~如果卡死或者3分钟都没有运行日志,可以重启重新运行", - QMessageBox.Information, 3000) - return - - self.running_flag = 1 - - self.show_message_box("提示", "3秒后开始运行,运行可能比较缓慢,请耐心等待,如果3分钟都没有运行日志输出,则可能是程序卡死,建议重启~", - QMessageBox.Information, 3000) - - def delayed_run(): - # 判断当前位于的页面,如果是聊天页,则不跳转到运行页 - if self.stackedWidget_index != 3: - # 切换到索引为 1 的页面 运行页 - self.ui.stackedWidget.setCurrentIndex(1) - - # 开冲! - try: - # self.run_external_command() - # 连接信号与槽函数,用于接收输出并更新 UI - # thread.output_ready.connect(self.ui.textBrowser.setText) - - # 连接 output_ready 信号和 update_textbrowser 槽函数 - # thread.output_ready.connect(self.update_textbrowser) - - # 创建线程对象 - self.platform_thread = ExternalCommandThread() - self.platform_thread.platform = self.platform - # 启动线程执行 run_external_command() - self.platform_thread.start() - - # 设置定时器间隔为 300 毫秒 - self.timer.setInterval(300) - # 每次定时器触发时调用 update_text_browser 函数 - self.timer.timeout.connect(self.update_text_browser) - # 启动定时器 - self.timer.start() - - self.show_message_box("提示", "开始运行喵~\n不要忘记保存配置~", QMessageBox.Information, 3000) - except Exception as e: - logging.error("平台配置出错,程序自爆~\n{e}") - self.show_message_box("错误", f"平台配置出错,程序自爆~\n{e}", QMessageBox.Critical) - os._exit(0) - - # 启动定时器,延迟 秒后触发函数执行 - QTimer.singleShot(100, delayed_run) - - - # 切换至index页面 - def change_page(self, index): - self.stackedWidget_index = index - self.ui.stackedWidget.setCurrentIndex(index) - - - # 保存配置 - def on_pushButton_save_clicked(self): - self.throttled_save() - - # 初始化配置 - def on_pushButton_factory_clicked(self): - self.throttled_factory() - - # 运行 - def on_pushButton_run_clicked(self): - self.throttled_run() - - # 切换页面 - def on_pushButton_change_page_clicked(self, index): - self.throttled_change_page(index) - - - # 根据文案索引添加文案 - def copywriting_config_index_add(self): - try: - index = int(self.ui.lineEdit_copywriting_config_index.text()) - - tmp = { - "file_path": "", - "audio_path": "", - "play_list": [], - "continuous_play_num": 1, - "max_play_time": 5.0 - } - - # 追加数据到成员变量 - self.copywriting_config["config"].append(tmp) - - data_json = [] - tmp_json = { - "label_text": "文案存储路径" + str(index), - "label_tip": "文案文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["file_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_file_path", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "音频存储路径" + str(index), - "label_tip": "文案音频文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["audio_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_path", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "文案列表" + str(index), - "label_tip": "加载配置文件中配置的文案路径(data/copywriting/)下的所有文件,请勿放入其他非文案文件", - "data": [], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_copywriting_list", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "播放列表" + str(index), - "label_tip": "此处填写需要播放的音频文件全名,填写完毕后点击 保存配置。文件全名从音频列表中复制,换行分隔,请勿随意填写", - "data": tmp["play_list"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_play_list", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "已合成\n音频列表" + str(index), - "label_tip": "加载配置文件中配置的音频路径(out/copywriting/)下的所有文件,请勿放入其他非音频文件", - "data": [], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_list", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放数" + str(index), - "label_tip": "文案播放列表中连续播放的音频文件个数,如果超过了这个个数就会切换下一个文案列表", - "data": tmp["continuous_play_num"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_continuous_play_num", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放时间" + str(index), - "label_tip": "文案播放列表中连续播放音频的时长,如果超过了这个时长就会切换下一个文案列表", - "data": tmp["max_play_time"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_max_play_time", - "index": index - } - data_json.append(tmp_json) - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_copywriting_config.addWidget(widgets[i], row, 0) - self.ui.gridLayout_copywriting_config.addWidget(widgets[i + 1], row, 1) - row += 1 - - self.copywriting_refresh_list() - except Exception as e: - logging.error(traceback.format_exc()) - - - # 根据文案索引删除文案 - def copywriting_config_index_del(self): - try: - index = int(self.ui.lineEdit_copywriting_config_index.text()) - - # 删除指定索引的数据 - if 0 <= index < len(self.copywriting_config["config"]): - del self.copywriting_config["config"][index] - - self.copywriting_refresh_list() - except Exception as e: - logging.error(traceback.format_exc()) - - - # 加载文案 - def copywriting_select(self): - select_file_path = self.ui.lineEdit_copywriting_select.text() - if "" == select_file_path: - logging.warning(f"请输入 文案路径喵~") - self.show_message_box("警告", "请输入 文案路径喵~", QMessageBox.Critical, 3000) - return - - # 传入完整文件路径 绝对或相对 - logging.info(f"准备加载 文件:[{select_file_path}]") - new_file_path = os.path.join(select_file_path) - - content = common.read_file_return_content(new_file_path) - if content is None: - logging.error(f"读取失败!请检测配置、文件路径、文件名") - self.show_message_box("错误", "读取失败!请检测配置、文件路径、文件名", QMessageBox.Critical) - return - - self.ui.textEdit_copywriting_edit.setText(content) - - logging.info(f"成功加载文案:{select_file_path}") - self.show_message_box("提示", f"成功加载文案:{select_file_path}", QMessageBox.Information, 3000) - - self.copywriting_refresh_list() - - - def on_pushButton_copywriting_config_index_add_clicked(self): - self.throttled_copywriting_config_index_add() - - def on_pushButton_copywriting_config_index_del_clicked(self): - self.throttled_copywriting_config_index_del() - - - # 加载文案按钮 - def on_pushButton_copywriting_select_clicked(self): - self.throttled_copywriting_select() - - - # 刷新列表 - def copywriting_refresh_list(self): - try: - while self.ui.gridLayout_copywriting_config.count(): - item = self.ui.gridLayout_copywriting_config.takeAt(0) - widget = item.widget() - if widget is not None: - widget.deleteLater() - - data_json = [] - for index, tmp in enumerate(self.copywriting_config["config"]): - tmp_json = { - "label_text": "文案存储路径" + str(index), - "label_tip": "文案文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["file_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_file_path", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "音频存储路径" + str(index), - "label_tip": "文案音频文件存储路径,默认不可编辑。不建议更改。", - "data": tmp["audio_path"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_path", - "index": index - } - data_json.append(tmp_json) - - tmp_str = "" - copywriting_file_names = self.get_dir_txt_filename(self.copywriting_config["config"][index]['file_path']) - for tmp_copywriting_file_name in copywriting_file_names: - tmp_str = tmp_str + tmp_copywriting_file_name + "\n" - tmp_json = { - "label_text": "文案列表" + str(index), - "label_tip": "加载配置文件中配置的文案路径(data/copywriting/)下的所有文件,请勿放入其他非文案文件", - "data": [tmp_str], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_copywriting_list", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "播放列表" + str(index), - "label_tip": "此处填写需要播放的音频文件全名,填写完毕后点击 保存配置。文件全名从音频列表中复制,换行分隔,请勿随意填写", - "data": tmp["play_list"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_play_list", - "index": index - } - data_json.append(tmp_json) - - tmp_str = "" - copywriting_audio_file_names = self.get_dir_audio_filename(self.copywriting_config["config"][index]['audio_path']) - for tmp_copywriting_audio_file_name in copywriting_audio_file_names: - tmp_str = tmp_str + tmp_copywriting_audio_file_name + "\n" - tmp_json = { - "label_text": "已合成\n音频列表" + str(index), - "label_tip": "加载配置文件中配置的音频路径(out/copywriting/)下的所有文件,请勿放入其他非音频文件", - "data": [tmp_str], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_audio_list", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放数" + str(index), - "label_tip": "文案播放列表中连续播放的音频文件个数,如果超过了这个个数就会切换下一个文案列表", - "data": tmp["continuous_play_num"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_continuous_play_num", - "index": index - } - data_json.append(tmp_json) - - tmp_json = { - "label_text": "连续播放时间" + str(index), - "label_tip": "文案播放列表中连续播放音频的时长,如果超过了这个时长就会切换下一个文案列表", - "data": tmp["max_play_time"], - "widget_text": "", - "click_func": "", - "main_obj_name": "copywriting_config_max_play_time", - "index": index - } - data_json.append(tmp_json) - widgets = self.create_widgets_from_json(data_json) - - # 动态添加widget到对应的gridLayout - row = 0 - for i in range(0, len(widgets), 2): - self.ui.gridLayout_copywriting_config.addWidget(widgets[i], row, 0) - self.ui.gridLayout_copywriting_config.addWidget(widgets[i + 1], row, 1) - row += 1 - - logging.info("刷新文件列表") - except Exception as e: - logging.error(traceback.format_exc()) - self.show_message_box("错误", f"刷新失败!{e}", QMessageBox.Critical) - - - # 刷新列表按钮 - def on_pushButton_copywriting_refresh_list_clicked(self): - self.throttled_copywriting_refresh_list() - - - # 保存文案 - def copywriting_save(self): - content = self.ui.textEdit_copywriting_edit.toPlainText() - select_file_path = self.ui.lineEdit_copywriting_select.text() - if "" == select_file_path: - logging.warning(f"请输入 文案路径喵~") - return - - new_file_path = os.path.join(select_file_path) - if True == common.write_content_to_file(new_file_path, content): - self.show_message_box("提示", "保存成功~", QMessageBox.Information, 3000) - else: - self.show_message_box("错误", "保存失败!请查看日志排查问题", QMessageBox.Critical) - - - # 保存文案按钮 - def on_pushButton_copywriting_save_clicked(self): - self.throttled_copywriting_save() - - - # 合成音频 正经版 - async def copywriting_synthetic_audio_main(self): - select_file_path = self.ui.lineEdit_copywriting_select.text() - - # 将一个文件路径的字符串切分成路径和文件名 - folder_path, file_name = common.split_path_and_filename(select_file_path) - - flag = 0 - - # 判断文件是哪个路径的 - for copywriting_config in config.get("copywriting", "config"): - if folder_path == copywriting_config["file_path"]: - folder_path = copywriting_config["audio_path"] - flag = 1 - break - - if flag == 0: - logging.error(f"文件路径与配置不匹配,将默认输出到同路径") - self.show_message_box("提示", f"文件路径与配置不匹配,将默认输出到同路径", QMessageBox.Information, 3000) - - ret = await audio.copywriting_synthesis_audio(select_file_path, folder_path) - if ret is None: - logging.error(f"合成失败!请排查原因") - self.show_message_box("错误", "合成失败!请排查原因", QMessageBox.Critical) - else: - logging.info(f"合成成功,文件输出到:{ret}") - self.show_message_box("提示", f"合成成功,文件输出到:{ret}", QMessageBox.Information, 3000) - - # 刷新文案和音频列表 - self.copywriting_refresh_list() - - - # 合成音频 - def copywriting_synthetic_audio(self): - if self.running_flag != 1: - self.show_message_box("提醒", "请先点击“运行”,然后再进行合成操作", - QMessageBox.Information, 3000) - return - - result = QMessageBox.question( - None, "确认框", "开始合成后请勿做其他操作,耐心等待合成完成,您确定开始吗?", QMessageBox.Yes | QMessageBox.No - ) - if result == QMessageBox.No: - return - - asyncio.run(self.copywriting_synthetic_audio_main()) - - - - # 合成音频按钮 - def on_pushButton_copywriting_synthetic_audio_clicked(self): - self.throttled_copywriting_synthetic_audio() - - - # 循环播放 - def copywriting_loop_play(self): - if self.running_flag != 1: - self.show_message_box("提醒", "请先点击“运行”,然后再进行播放", - QMessageBox.Information, 3000) - return - - self.show_message_box("提示", "3秒后开始循环播放文案~", QMessageBox.Information, 3000) - audio.unpause_copywriting_play() - - - # 循环播放按钮 - def on_pushButton_copywriting_loop_play_clicked(self): - self.throttled_copywriting_loop_play() - - - # 暂停播放 - def copywriting_pause_play(self): - if self.running_flag != 1: - self.show_message_box("提醒", "请先点击“运行”,然后再进行暂停", - QMessageBox.Information, 3000) - return - - audio.pause_copywriting_play() - self.show_message_box("提示", "暂停文案完毕~", QMessageBox.Information, 3000) - - - # 暂停播放按钮 - def on_pushButton_copywriting_pause_play_clicked(self): - self.throttled_copywriting_pause_play() - - - ''' - 聊天页相关的函数 - ''' - - # 发送 聊天框内容 - def talk_chat_box_send(self): - global my_handle - - if self.running_flag != 1: - self.show_message_box("提醒", "请先点击“运行”,然后再进行聊天", - QMessageBox.Information, 3000) - return - - if my_handle is None: - from utils.my_handle import My_handle - - my_handle = My_handle(config_path) - if my_handle is None: - logging.error("程序初始化失败!") - self.show_message_box("错误", "程序初始化失败!请排查原因", QMessageBox.Critical) - os._exit(0) - - # 获取用户名和文本内容 - user_name = self.ui.lineEdit_talk_username.text() - content = self.ui.textEdit_talk_chat_box.toPlainText() - - # 清空聊天框 - self.ui.textEdit_talk_chat_box.setText("") - - data = { - "username": user_name, - "content": content - } - - # 正义执行 - my_handle.process_data(data, "comment") - - - # 发送 聊天框内容 进行复读 - def talk_chat_box_reread(self): - global my_handle - - if self.running_flag != 1: - self.show_message_box("提醒", "请先点击“运行”,然后再进行复读", - QMessageBox.Information, 3000) - return - - if my_handle is None: - from utils.my_handle import My_handle - - my_handle = My_handle(config_path) - if my_handle is None: - logging.error("程序初始化失败!") - self.show_message_box("错误", "程序初始化失败!请排查原因", QMessageBox.Critical) - os._exit(0) - - # 获取用户名和文本内容 - user_name = self.ui.lineEdit_talk_username.text() - content = self.ui.textEdit_talk_chat_box.toPlainText() - - # 清空聊天框 - self.ui.textEdit_talk_chat_box.setText("") - - data = { - "user_name": user_name, - "content": content - } - - # 正义执行 直接复读 - my_handle.reread_handle(data) - - - # 事件过滤器会监听 QTextEdit 内的按键事件,当按下回车键时,会调用 eventFilter 方法,然后执行 talk_handleEnterKey 方法中的自定义处理代码。 - def eventFilter(self, source, event): - # print(event.type()) - if (event.type() == QEvent.KeyPress and - event.key() == Qt.Key_Return and - source is self.ui.textEdit_talk_chat_box): - # 在这里执行回车按键事件的处理代码 - self.talk_handleEnterKey() - return True - return super().eventFilter(source, event) - - - def talk_handleEnterKey(self): - # 发送 聊天框内容 - self.talk_chat_box_send() - - - def on_pushButton_talk_chat_box_send_clicked(self): - self.throttled_talk_chat_box_send() - - - def on_pushButton_talk_chat_box_reread_clicked(self): - self.throttled_talk_chat_box_reread() - - - ''' - 餐单栏相关的函数 - ''' - def openBrowser_github(self): - url = QUrl("https://github.com/Ikaros-521/AI-Vtuber") # 指定要打开的网页地址 - QDesktopServices.openUrl(url) - - def openBrowser_video(self): - url = QUrl("https://space.bilibili.com/3709626/channel/collectiondetail?sid=1422512") # 指定要打开的网页地址 - QDesktopServices.openUrl(url) - - def openBrowser_online_doc(self): - url = QUrl("https://luna.docs.ie.cx") # 指定要打开的网页地址 - QDesktopServices.openUrl(url) - - # 跳转到官方Q群 - def openBrowser_official_qq_group(self): - url = QUrl("https://qm.qq.com/cgi-bin/qm/qr?k=sYTkGUFactreB4MJZx-aPeWvYtpWaJYG&jump_from=webapi&authKey=NVHJc5hDHOk0ynysKZ8BqIpnLxYfsJWnCb0vH02xBwE2BYP8UPSce7qJ4EPa6wGu") # 指定要打开的网页地址 - QDesktopServices.openUrl(url) - - # 弹出关于窗口 - def alert_about(self): - about_str = """ -项目地址:https://github.com/Ikaros-521/AI-Vtuber -视频教程:https://space.bilibili.com/3709626/channel/collectiondetail?sid=1422512 -在线文档:https://luna.docs.ie.cx - -项目完全免费,如果您是在第三方平台购买了本项目,均为盗版,请及时止损(可怜的娃呀~) - """ - self.show_message_box("关于", about_str, QMessageBox.Information, 180000) - - def exit_soft(self): - os._exit(0) - - ''' - UI操作的函数 - ''' - # 自定义板块显隐 - def show_box_clicked(self, status, text): - box_obj_name = "groupBox_" + text - # 使用getattr()函数来从self.ui对象中获取属性。getattr()函数接收三个参数:对象,属性名(字符串),和默认值(可选)。 - # 如果属性存在,则返回对应的属性值(在这里是一个groupBox对象),否则返回默认值(在这里是None)。 - # 这样就可以根据字符串构造变量名,并获取对应的groupBox对象。 - box_widget = getattr(self.ui, box_obj_name, None) - if box_widget is not None: - box_widget.setVisible(status) - - - # 聊天类型改变 加载显隐不同groupBox - def oncomboBox_chat_type_IndexChanged(self, index): - # 各index对应的groupbox的显隐值 - visibility_map = { - 0: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 1: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 2: (1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 3: (0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 4: (0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 5: (0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0), - 6: (1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0), - 7: (0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0), - 8: (0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0), - 9: (0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0), - 10: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0), - 11: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0), - 12: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0), - 13: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0), - 14: (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1), - } - - visibility_values = visibility_map.get(index, (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) - - self.ui.groupBox_openai.setVisible(visibility_values[0]) - self.ui.groupBox_chatgpt.setVisible(visibility_values[1]) - self.ui.groupBox_header.setVisible(visibility_values[2]) - self.ui.groupBox_claude.setVisible(visibility_values[3]) - self.ui.groupBox_claude2.setVisible(visibility_values[4]) - self.ui.groupBox_chatglm.setVisible(visibility_values[5]) - self.ui.groupBox_chat_with_file.setVisible(visibility_values[6]) - self.ui.groupBox_chatterbot.setVisible(visibility_values[7]) - self.ui.groupBox_text_generation_webui.setVisible(visibility_values[8]) - self.ui.groupBox_sparkdesk.setVisible(visibility_values[9]) - self.ui.groupBox_langchain_chatglm.setVisible(visibility_values[10]) - self.ui.groupBox_zhipu.setVisible(visibility_values[11]) - self.ui.groupBox_bard.setVisible(visibility_values[12]) - self.ui.groupBox_yiyan.setVisible(visibility_values[13]) - self.ui.groupBox_tongyi.setVisible(visibility_values[14]) - - - # 语音合成类型改变 加载显隐不同groupBox - # 当你新增TTS时,你需要同步修改此处的TTS配置的显隐 - def oncomboBox_audio_synthesis_type_IndexChanged(self, index): - # 各index对应的groupbox的显隐值 - visibility_map = { - 0: (1, 0, 0, 0, 0, 0, 0, 0), - 1: (0, 1, 0, 0, 0, 0, 0, 0), - 2: (0, 0, 1, 0, 0, 0, 0, 0), - 3: (0, 0, 0, 1, 0, 0, 0, 0), - 4: (0, 0, 0, 0, 1, 0, 0, 0), - 5: (0, 0, 0, 0, 0, 1, 0, 0), - 6: (0, 0, 0, 0, 0, 0, 1, 0), - 7: (0, 0, 0, 0, 0, 0, 0, 1) - } - - visibility_values = visibility_map.get(index, (0, 0, 0, 0, 0, 0, 0, 0)) - - self.ui.groupBox_edge_tts.setVisible(visibility_values[0]) - self.ui.groupBox_vits.setVisible(visibility_values[1]) - self.ui.groupBox_vits_fast.setVisible(visibility_values[2]) - self.ui.groupBox_elevenlabs.setVisible(visibility_values[3]) - self.ui.groupBox_genshinvoice_top.setVisible(visibility_values[4]) - self.ui.groupBox_bark_gui.setVisible(visibility_values[5]) - self.ui.groupBox_vall_e_x.setVisible(visibility_values[6]) - self.ui.groupBox_openai_tts.setVisible(visibility_values[7]) - - - # 语音识别类型改变 加载显隐不同groupBox - def oncomboBox_talk_type_IndexChanged(self, index): - # 各index对应的groupbox的显隐值 - visibility_map = { - 0: (1, 0), - 1: (0, 1) - } - - visibility_values = visibility_map.get(index, (0, 0)) - - self.ui.groupBox_talk_baidu.setVisible(visibility_values[0]) - self.ui.groupBox_talk_google.setVisible(visibility_values[1]) - - - # 输出文本到运行页的textbrowser - # def output_to_textbrowser(self, content): - # max_content_len = 10000 - - # text = self.ui.textBrowser.toPlainText() + content # 将新内容添加到已有内容后面 - # if len(text) > max_content_len: - # text = text[-max_content_len:] # 保留最后一万个字符,截断超出部分 - # self.ui.textBrowser.setText(text) - - - # def update_textbrowser(self, output_text): - # cursor = self.ui.textBrowser.textCursor() - # cursor.movePosition(QTextCursor.End) - # cursor.insertText(output_text) - # self.ui.textBrowser.setTextCursor(cursor) - # self.ui.textBrowser.ensureCursorVisible() - - - # 获取一个文件最后num_lines行数据 - def load_last_lines(self, file_path, num_lines=1000): - lines = [] - with open(file_path, 'r', encoding="utf-8") as file: - # 将文件内容逐行读取到列表中 - lines = file.readlines() - - # 只保留最后1000行文本 - last_lines = lines[-num_lines:] - - # 倒序排列文本行 - last_lines.reverse() - - return last_lines - - - # 清空text_browser,显示文件内的数据 - def update_text_browser(self): - global file_path - - # 记录当前的滚动位置 - scroll_position = self.ui.textBrowser.verticalScrollBar().value() - scroll_position_talk_log = self.ui.textBrowser_talk_log.verticalScrollBar().value() - - # print(f"scroll_position={scroll_position}, scroll_position_talk_log={scroll_position_talk_log}") - - # 加载文件的最后1000行文本 - last_lines = self.load_last_lines(file_path) - - # 获取当前文本光标 - cursor = self.ui.textBrowser.textCursor() - cursor_talk_log = self.ui.textBrowser_talk_log.textCursor() - - # 获取当前选中的文本 - selected_text = cursor.selectedText() - selected_text_talk_log = cursor_talk_log.selectedText() - - # 判断是否有选中的文本 - has_selection = len(selected_text) > 0 - has_selection_talk_log = len(selected_text_talk_log) > 0 - - # 清空 textBrowser - self.ui.textBrowser.clear() - self.ui.textBrowser_talk_log.clear() - - # 设置文本浏览器打开外部链接功能 - self.ui.textBrowser.setOpenExternalLinks(True) - self.ui.textBrowser_talk_log.setOpenExternalLinks(True) - - # 将文本逐行添加到 textBrowser 中 - for line in last_lines: - self.ui.textBrowser.insertPlainText(line) - self.ui.textBrowser_talk_log.insertPlainText(line) - - # 恢复滚动位置 - if not has_selection: - self.ui.textBrowser.verticalScrollBar().setValue(scroll_position) - - if not has_selection_talk_log: - self.ui.textBrowser_talk_log.verticalScrollBar().setValue(scroll_position_talk_log) - - - ''' - 通用的函数 - ''' - # 获取本地音频文件夹内所有的txt文件名 - def get_dir_txt_filename(self, txt_path): - try: - # 使用 os.walk 遍历文件夹及其子文件夹 - txt_files = [] - for root, dirs, files in os.walk(txt_path): - for file in files: - if file.endswith(('.txt')): - txt_files.append(os.path.join(root, file)) - - # 提取文件名 - file_names = [os.path.basename(file) for file in txt_files] - # 保留子文件夹路径 - # file_names = [os.path.relpath(file, txt_path) for file in txt_files] - - logging.debug("获取到文案文件名列表如下:") - logging.debug(file_names) - - return file_names - except Exception as e: - logging.error(traceback.format_exc()) - return None - - - # 获取本地音频文件夹内所有的音频文件名 - def get_dir_audio_filename(self, audio_path): - try: - # 使用 os.walk 遍历文件夹及其子文件夹 - audio_files = [] - for root, dirs, files in os.walk(audio_path): - for file in files: - if file.endswith(('.MP3', '.mp3', '.WAV', '.wav', '.flac', '.aac', '.ogg', '.m4a')): - audio_files.append(os.path.join(root, file)) - - # 提取文件名 - audio_file_names = [os.path.basename(file) for file in audio_files] - # 保留子文件夹路径 - # file_names = [os.path.relpath(file, song_path) for file in audio_audio_files] - - logging.debug("获取到本地文案音频文件名列表如下:") - logging.debug(audio_file_names) - - return audio_file_names - except Exception as e: - logging.error(traceback.format_exc()) - return None - - - def restart_application(self): - QApplication.exit() # Exit the current application instance - python = sys.executable - os.execl(python, python, *sys.argv) # Start a new instance of the application - - - # 字符串是否只由字母或数字组成 - def is_alpha_numeric(self, string): - pattern = r'^[a-zA-Z0-9]+$' - return re.match(pattern, string) is not None - - - # 显示提示弹窗框,自动关闭时间(单位:毫秒) - def show_message_box(self, title, text, icon=QMessageBox.Information, timeout_ms=60 * 1000): - msg_box = QMessageBox() - msg_box.setWindowTitle(title) - msg_box.setText(text) - msg_box.setIcon(icon) - - def close_message_box(): - msg_box.close() - - QTimer.singleShot(timeout_ms, close_message_box) - - msg_box.exec_() - - - # 套娃运行喵(会卡死) - def run_external_command(self): - module = importlib.import_module(self.platform) - platform_process = subprocess.Popen([sys.executable, '-c', 'import {}'.format(module.__name__)], stdout=subprocess.PIPE, stderr=subprocess.PIPE, - args=(AI_VTB.terminate_event,)) - output, _ = platform_process.communicate() - output_text = output.decode("utf-8") # 将字节流解码为字符串 - self.output_to_textbrowser(output_text) - - # 调用 start_server() 并将输出追加到 textbrowser - start_server_output = module.start_server() # 调用 start_server() 函数并获取输出 - output_text += start_server_output - - - # 节流函数,单位时间内只执行一次函数 - def throttle(self, func, delay): - last_executed = 0 - - def throttled(*args, **kwargs): - nonlocal last_executed - current_time = time.time() - if current_time - last_executed > delay: - last_executed = current_time - func(*args, **kwargs) - - return throttled - - -# 执行额外命令的线程 -class ExternalCommandThread(QThread): - output_ready = pyqtSignal(str) - - def __init__(self, platform=None): - super().__init__() - self.platform = platform - - def run(self): - if self.platform is None: - # 处理没有传递 platform 的情况 - self.output_ready.emit("没有传入platform,取名为寄!") - return - - logging.debug(f"platform={self.platform}") - - module = importlib.import_module(self.platform) - AI_VTB.platform_process = subprocess.Popen([sys.executable, '-c', 'import {}'.format(module.__name__)], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - output, _ = AI_VTB.platform_process.communicate() - # logging.debug(output) - # output_text = output.decode("utf-8") # 将字节流解码为字符串 - - # 调用 start_server() 并将输出追加到 textbrowser - start_server_output = module.start_server() # 调用 start_server() 函数并获取输出 - # output_text += start_server_output - - -# web服务线程 -class WebServerThread(QThread): - def run(self): - Handler = http.server.SimpleHTTPRequestHandler - with socketserver.TCPServer(("", web_server_port), Handler) as httpd: - logging.info(f"Web运行在端口:{web_server_port}") - logging.info(f"可以直接访问Live2D页, http://127.0.0.1:{web_server_port}/Live2D/") - httpd.serve_forever() - - -# 退出程序 -def exit_handler(signum, frame): - print("收到信号:", signum) - - os._exit(0) - - -# 程序入口 -if __name__ == '__main__': - common = Common() - my_handle = None - - if getattr(sys, 'frozen', False): - # 当前是打包后的可执行文件 - bundle_dir = getattr(sys, '_MEIPASS', os.path.abspath(os.path.dirname(sys.executable))) - file_relative_path = os.path.dirname(os.path.abspath(bundle_dir)) - else: - # 当前是源代码 - file_relative_path = os.path.dirname(os.path.abspath(__file__)) - - # logging.info(file_relative_path) - - # 创建日志文件夹 - log_dir = os.path.join(file_relative_path, 'log') - if not os.path.exists(log_dir): - os.makedirs(log_dir) - - # 创建音频输出文件夹 - audio_out_dir = os.path.join(file_relative_path, 'out') - if not os.path.exists(audio_out_dir): - os.makedirs(audio_out_dir) - - # # 创建配置文件夹 - # config_dir = os.path.join(file_relative_path, 'config') - # if not os.path.exists(config_dir): - # os.makedirs(config_dir) - - # 配置文件路径 - config_path = os.path.join(file_relative_path, 'config.json') - - audio = Audio(config_path, 2) - - # 日志文件路径 - file_path = "./log/log-" + common.get_bj_time(1) + ".txt" - Configure_logger(file_path) - - # 获取 httpx 库的日志记录器 - httpx_logger = logging.getLogger("httpx") - # 设置 httpx 日志记录器的级别为 WARNING - httpx_logger.setLevel(logging.WARNING) - - web_server_port = 12345 - - # 本地测试时候的日志设置 - ''' - # 日志格式 - log_format = '%(asctime)s - %(pathname)s[line:%(lineno)d] - %(levelname)s: %(message)s' - # 日志文件路径 - file_path = os.path.join(file_relative_path, 'log/log.txt') - - # 自定义控制台输出类 - class ColoredStreamHandler(logging.StreamHandler): - """ - 自定义 StreamHandler 类,用于在控制台中为不同级别的日志信息设置不同的颜色 - """ - def __init__(self): - super().__init__() - self._colors = { - logging.DEBUG: '\033[1;34m', # 蓝色 - logging.INFO: '\033[1;37m', # 白色 - logging.WARNING: '\033[1;33m', # 黄色 - logging.ERROR: '\033[1;31m', # 红色 - logging.CRITICAL: '\033[1;35m' # 紫色 - } - - def emit(self, record): - # 根据日志级别设置颜色 - color = self._colors.get(record.levelno, '\033[0m') # 默认为关闭颜色设置 - # 设置日志输出格式和颜色 - self.stream.write(color) - super().emit(record) - self.stream.write('\033[0m') - - # 创建 logger 对象并设置日志级别 - logger = logging.getLogger(__name__) - logging.setLevel(logging.DEBUG) - - # 创建 FileHandler 对象和 StreamHandler 对象并设置日志级别 - fh = logging.FileHandler(file_path, encoding='utf-8', mode='a+') - fh.setLevel(logging.DEBUG) - ch = ColoredStreamHandler() - ch.setLevel(logging.DEBUG) - - # 创建 Formatter 对象并设置日志输出格式 - formatter = logging.Formatter(log_format) - fh.setFormatter(formatter) - ch.setFormatter(formatter) - - # 将 FileHandler 对象和 ColoredStreamHandler 对象添加到 logger 对象中 - logging.addHandler(fh) - logging.addHandler(ch) - ''' - - - logging.debug("配置文件路径=" + str(config_path)) - - # 实例化配置类 - config = Config(config_path) - - try: - if config.get("live2d", "enable"): - web_server_port = int(config.get("live2d", "port")) - # 创建 web服务线程 - web_server_thread = WebServerThread() - # 运行 web服务线程 - web_server_thread.start() - except Exception as e: - logging.error(traceback.format_exc()) - os._exit(0) - - signal.signal(signal.SIGINT, exit_handler) - signal.signal(signal.SIGTERM, exit_handler) - - e = AI_VTB() - - sys.exit(e.app.exec()) - diff --git a/ui/main.ui b/ui/main.ui deleted file mode 100644 index c441c1ba..00000000 --- a/ui/main.ui +++ /dev/null @@ -1,4420 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 1191 - 834 - - - - AI Vtuber - - - background-color: rgba(255, 255, 255, 50); - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #e6a23c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - ②运行页 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #e6a23c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - ③文案页 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: rgba(103, 194, 58, 255); -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - 运行 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #e6a23c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - ①配置页 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: rgba(64, 158, 255, 255); -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - 保存配置 - - - - - - - background-color: rgba(255, 255, 255, 0); -font: 75 14pt "微软雅黑"; - - - 0 - - - - - - - font: 75 14pt "微软雅黑"; -background-color: rgba(255, 255, 255, 50); - - - - Qt::ScrollBarAsNeeded - - - true - - - - - 0 - -6720 - 991 - 11374 - - - - - 20 - - - 35 - - - 20 - - - 35 - - - 20 - - - - - background-color: rgba(255, 255, 255, 0); - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - PointingHandCursor - - - - - - - 念弹幕 - - - - - - - - - - - - 提示词前缀 - - - - - - - 音频随机变速 - - - - - - - - - - - 普通音频变速 - - - - - - - 速度下限 - - - - - - - 速度上限 - - - - - - - 启用 - - - - - - - - - - 文案音频变速 - - - - - - - 启用 - - - - - - - 速度下限 - - - - - - - - - - 速度上限 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 念用户名 - - - - - - - - 前置回复 - - - - - - - - - - 启用 - - - - - - - - - - - - - - 启用变声 - - - - - - - - - - - - - - 后置回复 - - - - - - - - - - - - - - - 音频播放 - - - - - - - - - - - - false - - - 平台 - - - - - - - 回复语言 - - - - - - - 自定义显示板块 - - - - - - - - - - - - Claude2 - - - - - - - - - - - - - - https代理地址 - - - - - - - socks5代理地址 - - - - - - - 启用 - - - - - - - cookie - - - - - - - 启用代理 - - - - - - - http代理地址 - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - xuniren - - - - - - - - - - - - 提示词后缀 - - - - - - - ChatGLM - - - - - - - - api地址 - - - - - - - - - - 最大记忆长度 - - - - - - - - - - 前p个选择 - - - - - - - 温度 - - - - - - - - - - - - - 最大长度限制 - - - - - - - 上下文记忆 - - - - - - - 启用 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 直播间号 - - - - - - - openai - - - - - - 2 - - - - - API - - - - - - - - - - API KEY - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - 虚拟身体 - - - - - - - PointingHandCursor - - - - - - - 聊天类型 - - - - - - - 本地问答 - - - - - - - - 音频匹配 - - - - - - - 文本匹配 - - - - - - - 启用 - - - - - - - - - - 音频最低相似度 - - - - - - - 启用 - - - - - - - 文本最低相似度 - - - - - - - - - - 音频存储路径 - - - - - - - 文本问答数据路径 - - - - - - - - - - - - - 文本问答算法类型 - - - - - - - - 自定义json - - - - - 一问一答 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Claude - - - - - - - - - - - slack_user_token - - - - - - - bot_user_id - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - PointingHandCursor - - - - 所有 - - - - - 中文 - - - - - 英文 - - - - - 日文 - - - - - - - - 日志 - - - - - - - - - 问答 - - - - - 问题 - - - - - 回答 - - - - - 不记录 - - - - - - - - 弹幕日志类型 - - - - - - - 字幕日志路径 - - - - - - - - - - 字幕日志 - - - - - - - 启用 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 过滤 - - - - - - - - 聊天保留数 - - - - - - - - - - - - - - - - - - - 弹幕保留数 - - - - - - - 最大单词数 - - - - - - - - - - 最大字符数 - - - - - - - - - - - - - 入场保留数 - - - - - - - 聊天遗忘间隔 - - - - - - - 违禁词路径 - - - - - - - 定时遗忘间隔 - - - - - - - 弹幕遗忘间隔 - - - - - - - - - - - - - 关注遗忘间隔 - - - - - - - - - - 违禁拼音路径 - - - - - - - - - - - - - 礼物保留数 - - - - - - - - - - 弹幕前缀 - - - - - - - - - - 弹幕后缀 - - - - - - - - - - 定时保留数 - - - - - - - 礼物遗忘间隔 - - - - - - - - - - 入场遗忘间隔 - - - - - - - 关注保留数 - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - twitch - - - - - - - - - - - - 语音合成 - - - - - - - - - - PointingHandCursor - - - - 不启用 - - - - - 复读机 - - - - - ChatGPT - - - - - Claude - - - - - ChatGLM - - - - - chat_with_file - - - - - Chatterbot - - - - - text-generation-webui - - - - - 讯飞星火 - - - - - Langchain_ChatGLM - - - - - - - - - - - 哔哩哔哩 - - - - - - - - - - - - - - - 答谢 - - - - - - 关注答谢 - - - - - - - 入场欢迎 - - - - - - - 入场文案 - - - - - - - - - - 关注文案 - - - - - - - 礼物文案 - - - - - - - 礼物答谢 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 启用 - - - - - - - - - - 最低答谢价格 - - - - - - - - - - 启用 - - - - - - - 启用 - - - - - - - - - - chatgpt - - - - - - - - - - - 模型 - - - - - - - 最大令牌数 - - - - - - - - - - 温度 - - - - - - - 前p个选择 - - - - - - - - - - - - - 频率惩罚 - - - - - - - - - - 存在惩罚 - - - - - - - 预设 - - - - - - - - - - - gpt-3.5-turbo - - - - - gpt-3.5-turbo-0301 - - - - - gpt-3.5-turbo-0613 - - - - - gpt-3.5-turbo-16k - - - - - gpt-3.5-turbo-16k-0613 - - - - - gpt-4 - - - - - gpt-4-0314 - - - - - gpt-4-0613 - - - - - gpt-4-32k - - - - - gpt-4-32k-0314 - - - - - gpt-4-32k-0613 - - - - - text-embedding-ada-002 - - - - - text-davinci-003 - - - - - text-davinci-002 - - - - - text-curie-001 - - - - - text-babbage-001 - - - - - text-ada-001 - - - - - text-moderation-latest - - - - - text-moderation-stable - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - audio_player - - - - - - - - - - - - - - - 智谱AI - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Langchain_ChatGLM - - - - - - - - api地址 - - - - - - - - - - 聊天类型 - - - - - - - 上下文记忆 - - - - - - - - - - 启用 - - - - - - - - - - 知识库名称 - - - - - - - 最大记忆长度 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - chat_with_file - - - - - - 6 - - - - - 模型 - - - - - - - pdf文件路径 - - - - - - - 显示成本 - - - - - - - 聊天模式 - - - - - - - 最大查询数据库次数 - - - - - - - 问题总结提示词 - - - - - - - - - - 块大小 - - - - - - - - - - 链类型 - - - - - - - PointingHandCursor - - - 启用 - - - - - - - - - - - claude - - - - - openai_gpt - - - - - openai_vector_search - - - - - - - - - - - 分隔符 - - - - - - - - - - 块重叠 - - - - - - - - sebastian-hofstaetter/distilbert-dot-tas_b-b256-msmarco - - - - - GanymedeNil/text2vec-large-chinese - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - text-generation-webui - - - - - - - - - - - - - - - - - - - - max_new_tokens - - - - - - - 角色 - - - - - - - api地址 - - - - - - - - - - instruction_template - - - - - - - 模式 - - - - - - - 你的名字 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 讯飞星火 - - - - - - - - api_key - - - - - - - - - - api_secret - - - - - - - - - - - - - - - - cookie - - - - - - - 类型 - - - - - - - app_id - - - - - - - - - - - - - fd - - - - - - - GtToken - - - - - - - - - - 版本 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Bard - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 文心一言 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 通义千问 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Chatterbot - - - - - - - - - - - bot名称 - - - - - - - 数据库路径 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Edge-TTS - - - - - - - - - - - 语速增益 - - - - - - - 说话人 - - - - - - - 音量增益 - - - - - - - - - - - 16777215 - 100 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - VITS - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - VITS-Fast - - - - - - - - 配置文件路径 - - - - - - - 语速 - - - - - - - - - - 说话人 - - - - - - - - - - - - - API地址 - - - - - - - 语言 - - - - - - - - - - - 自动识别 - - - - - 日本語 - - - - - 简体中文 - - - - - English - - - - - Mix - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - genshinvoice_top - - - - - - - - 角色 - - - - - - - 音素长度 - - - - - - - 格式 - - - - - - - - - - 语速 - - - - - - - - - - - - - - - - - - - 感情 - - - - - - - 语言 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - elevenlabs - - - - - - - - - - - 说话人 - - - - - - - - - - api密钥 - - - - - - - 模型 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - bark-gui - - - - - - - - API地址 - - - - - - - 快速生成 - - - - - - - 批量数 - - - - - - - 句末概率 - - - - - - - 随机种子 - - - - - - - 生成温度 - - - - - - - 波形温度 - - - - - - - 说话人 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 启用 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - VALL-E-X - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - OpenAI TTS - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Live2D - - - - - - - - - - - - - - - - - - 端口 - - - - - - - 启用 - - - - - - - 模型名 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 点歌模式 - - - - - - - - 取消点歌命令 - - - - - - - - - - 歌曲路径 - - - - - - - - - - - - - - - - - 点歌触发命令 - - - - - - - 启用 - - - - - - - 匹配失败文案 - - - - - - - - - - - - - - - - 随机点歌命令 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 定时任务 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 闲时任务 - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - LLM模式 - - - - - - - - - - - - 本地音频模式 - - - - - - - - - - - - - - - DDSP_SVC - - - - - - - - 启用 - - - - - - - 安全前缀填充长度 - - - - - - - - - - - - - - - - - - - - API地址 - - - - - - - 配置文件路径 - - - - - - - - - - - - - 说话人ID - - - - - - - - - - 变调 - - - - - - - 采样率 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - so-vits-svc - - - - - - - - - - - - - - - - - - 配置文件路径 - - - - - - - API地址 - - - - - - - - - - - - - 启用 - - - - - - - 说话人 - - - - - - - - - - 音调 - - - - - - - 输出音频格式 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - Stable Diffusion - - - - - - - - - - - - - - - - - - - - 端口 - - - - - - - - - - 高分辨率生成 - - - - - - - - - - - - - - - - 高分辨率缩放因子 - - - - - - - - - - - - - - - - - - - 图像水平像素 - - - - - - - 高分生二次传递步数 - - - - - - - 去噪强度 - - - - - - - LLM类型 - - - - - - - 提示词前缀 - - - - - - - 启用 - - - - - - - 弹幕触发前缀 - - - - - - - IP地址 - - - - - - - 生成图像步数 - - - - - - - 随机种子 - - - - - - - - - - 图像风格 - - - - - - - 启用 - - - - - - - 提示词相关性 - - - - - - - - - - 图像垂直像素 - - - - - - - - - - - - - - - - - 负面提示词 - - - - - - - 提示词后缀 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 动态文案 - - - - - - - - 随机播放 - - - - - - - 启用 - - - - - - - - - - - - - 文案播放间隔 - - - - - - - 启用 - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 请求头 - - - - - - - - userAgent - - - - - - - Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36 Edg/113.0.1774.42 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - web字幕打印机 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 数据库 - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 按键映射 - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - 启用 - - - - - - - - - - 命令前缀 - - - - - - - 类型 - - - - - - - - - - - - - - - - - - Unity - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - font: 12pt "仿宋"; - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'仿宋'; font-size:12pt; font-weight:400; font-style:normal;"> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'SimSun'; font-size:9pt;"><br /></p></body></html> - - - - - - - - - - - font: 75 13pt "微软雅黑"; - - - - true - - - - - 0 - 0 - 698 - 1156 - - - - - - - false - - - - - - - - - - - - 编辑文案 - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 保存文案 - - - - - - - - 0 - 500 - - - - - 16777215 - 16777215 - - - - true - - - - - 0 - 0 - 359 - 104 - - - - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 增加 - - - - - - - min-height:40px; - - - - - - - 文案编号 - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 删除 - - - - - - - - - - - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 暂停播放 - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 合成音频 - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 循环播放 - - - - - - - min-height:40px; - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 刷新列表 - - - - - - - - - - 选择文案 - - - - - - - - - - 音频随机播放 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 音频播放间隔 - - - - - - - min-height:40px; - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 加载 - - - - - - - min-height:300px; - - - - - - - min-height:50px; - - - - - - - min-height:40px; - - - 启用 - - - - - - - - - - 音频切换间隔 - - - - - - - 自动播放 - - - - - - - 启用 - - - - - - - - - - - - - - - - - - font: 75 14pt "微软雅黑"; - - - - true - - - - - 0 - 0 - 433 - 911 - - - - - - - - - - 启用 - - - - - - - - - - 连续对话 - - - - - - - - - - 你的名字 - - - - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 直接复读 - - - - - - - 谷歌 - - - - - - - - - 目标翻译语言 - - - - - - - - - - PointingHandCursor - - - text-align: center; -padding: 12px 16px; -font: 80 10pt "微软雅黑"; -border:2px solid #ffffff; -border-radius: 3px; - - - 发送 - - - - - - - - - - 沉默阈值 - - - - - - - 停录按键 - - - - - - - 录音按键 - - - - - - - font: 12pt "仿宋"; -min-height:200px; - - - - - - - - 音量阈值 - - - - - - - - - - 录音类型 - - - - - - - 聊天框 - - - - - - - - - - - - - 百度 - - - - - - - - - AppID - - - - - - - - - - API Key - - - - - - - Secret Key - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - true - - - - - 0 - 0 - 181 - 631 - - - - - - - - - - 入场 - - - - - - - - - 文案 - - - - - - - - - - - - - - - 签到 - - - - - - - - - 文案 - - - - - - - - - - - - - - - 礼物 - - - - - - - - - 文案 - - - - - - - - - - - - - - - 增删改查 - - - - - - - - 查询 - - - - - - - - - - - - - - - - - 通用 - - - - - - - - 启用 - - - - - - - - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #e6a23c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - ④聊天页 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #e6a23c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - ⑤积分页 - - - - - - - PointingHandCursor - - - border: 1px solid #dcdfe6; -background-color: #f56c6c; -text-align: center; -padding: 12px 16px; -border-radius: 4px; -font: 75 12pt "微软雅黑"; - - - 恢复出厂配置 - - - - - - - - - 0 - 0 - 1191 - 26 - - - - - 帮助 - - - - - - - - - - - - 文件 - - - - - - - - - - 官方仓库 - - - - - 视频教程 - - - - - 退出 - - - - - 在线文档 - - - - - 关于 - - - - - 本软件完全免费 - - - - - 官方Q群:587663288 - - - - - -