gradio: rule_type切换,rule_list清空
Browse files
app.py
CHANGED
@@ -115,7 +115,7 @@ def update_input_components(dataset_source):
|
|
115 |
def update_rule_list(rule_type_mapping, rule_type):
|
116 |
return gr.CheckboxGroup(
|
117 |
choices=rule_type_mapping.get(rule_type, []),
|
118 |
-
|
119 |
label="rule_list"
|
120 |
)
|
121 |
|
@@ -255,11 +255,9 @@ def get_data_column_mapping():
|
|
255 |
|
256 |
|
257 |
if __name__ == '__main__':
|
258 |
-
rule_options = ['RuleAbnormalChar', 'RuleAbnormalHtml', 'RuleContentNull', 'RuleContentShort', 'RuleEnterAndSpace', 'RuleOnlyUrl']
|
259 |
rule_type_mapping = get_rule_type_mapping()
|
260 |
rule_type_options = list(rule_type_mapping.keys())
|
261 |
|
262 |
-
# prompt_options = ['PromptRepeat', 'PromptContentChaos']
|
263 |
scene_prompt_mapping = get_scene_prompt_mapping()
|
264 |
scene_options = list(scene_prompt_mapping.keys())
|
265 |
|
|
|
115 |
def update_rule_list(rule_type_mapping, rule_type):
|
116 |
return gr.CheckboxGroup(
|
117 |
choices=rule_type_mapping.get(rule_type, []),
|
118 |
+
value=[],
|
119 |
label="rule_list"
|
120 |
)
|
121 |
|
|
|
255 |
|
256 |
|
257 |
if __name__ == '__main__':
|
|
|
258 |
rule_type_mapping = get_rule_type_mapping()
|
259 |
rule_type_options = list(rule_type_mapping.keys())
|
260 |
|
|
|
261 |
scene_prompt_mapping = get_scene_prompt_mapping()
|
262 |
scene_options = list(scene_prompt_mapping.keys())
|
263 |
|