Spaces:
Runtime error
Runtime error
submit_button.click(
Browse files
app.py
CHANGED
@@ -136,15 +136,33 @@ if __name__ == "__main__":
|
|
136 |
language = gr.Dropdown(choices=["中文", "英文"], label="語言")
|
137 |
generation_mode = gr.Dropdown(choices=["auto", "manual"], label="生成方式")
|
138 |
rounds = gr.Slider(minimum=2, maximum=6, step=2, label="對話輪數")
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
|
144 |
# 在这里添加提交和清除按鈕
|
145 |
submit_button = gr.Button("Submit", style={"background-color": "#FFA500", "color": "white"})
|
146 |
clear_button = gr.Button("Clear")
|
147 |
-
submit_button.click(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
clear_button.click(lambda: None, None, [chat_output, json_file, json_textbox], queue=False)
|
149 |
|
150 |
|
|
|
136 |
language = gr.Dropdown(choices=["中文", "英文"], label="語言")
|
137 |
generation_mode = gr.Dropdown(choices=["auto", "manual"], label="生成方式")
|
138 |
rounds = gr.Slider(minimum=2, maximum=6, step=2, label="對話輪數")
|
139 |
+
role1_name = gr.Textbox(label="角色 1 名稱")
|
140 |
+
role1_gender = gr.Dropdown(choices=["male", "female"], label="角色 1 性別")
|
141 |
+
role2_name = gr.Textbox(label="角色 2 名稱")
|
142 |
+
role2_gender = gr.Dropdown(choices=["male", "female"], label="角色 2 性別")
|
143 |
|
144 |
# 在这里添加提交和清除按鈕
|
145 |
submit_button = gr.Button("Submit", style={"background-color": "#FFA500", "color": "white"})
|
146 |
clear_button = gr.Button("Clear")
|
147 |
+
submit_button.click(
|
148 |
+
main_function,
|
149 |
+
[
|
150 |
+
password,
|
151 |
+
theme,
|
152 |
+
language,
|
153 |
+
generation_mode,
|
154 |
+
rounds,
|
155 |
+
role1_name,
|
156 |
+
role1_gender,
|
157 |
+
role2_name,
|
158 |
+
role2_gender
|
159 |
+
],
|
160 |
+
[
|
161 |
+
chat_output,
|
162 |
+
json_file,
|
163 |
+
json_textbox
|
164 |
+
]
|
165 |
+
)
|
166 |
clear_button.click(lambda: None, None, [chat_output, json_file, json_textbox], queue=False)
|
167 |
|
168 |
|