Spaces:
Sleeping
Sleeping
Commit
·
fee4d3c
1
Parent(s):
408d434
update
Browse files
app.py
CHANGED
@@ -570,8 +570,8 @@ with gr.Blocks() as demo:
|
|
570 |
label = '{} (1/{})'.format(tpl_name, stage1_info["step3"]["totalNum"])
|
571 |
|
572 |
tpl_idx = channel_info["templateDict"][tpl_name]["index"]
|
573 |
-
|
574 |
-
|
575 |
|
576 |
stage1_info["state"] = "step3-2-selecting"
|
577 |
# determine which button to display
|
@@ -581,7 +581,7 @@ with gr.Blocks() as demo:
|
|
581 |
in_fillmode : gr.Dropdown(visible=False),
|
582 |
fillmode_btn : gr.Button(visible=False),
|
583 |
chkbox_group : gr.CheckboxGroup(choices=channel_info["inputOrder"],
|
584 |
-
value=
|
585 |
next_btn : gr.Button(visible=True)}
|
586 |
else:
|
587 |
yield {stage1_json : stage1_info,
|
@@ -589,7 +589,7 @@ with gr.Blocks() as demo:
|
|
589 |
in_fillmode : gr.Dropdown(visible=False),
|
590 |
fillmode_btn : gr.Button(visible=False),
|
591 |
chkbox_group : gr.CheckboxGroup(choices=channel_info["inputOrder"],
|
592 |
-
value=
|
593 |
step3_btn : gr.Button(visible=True)}
|
594 |
|
595 |
# =======================================step3-2========================================
|
@@ -737,19 +737,19 @@ with gr.Blocks() as demo:
|
|
737 |
label = '{} ({}/{})'.format(tpl_name, step3["count"], step3["totalNum"])
|
738 |
|
739 |
tpl_idx = channel_info["templateDict"][tpl_name]["index"]
|
740 |
-
|
741 |
-
|
742 |
|
743 |
stage1_info["step3"] = step3
|
744 |
# determine which button to display
|
745 |
if step3["count"] == step3["totalNum"]:
|
746 |
return {stage1_json : stage1_info,
|
747 |
-
chkbox_group : gr.CheckboxGroup(value=
|
748 |
step3_btn : gr.Button(visible=False),
|
749 |
next_btn : gr.Button(visible=True)}
|
750 |
else:
|
751 |
return {stage1_json : stage1_info,
|
752 |
-
chkbox_group : gr.CheckboxGroup(value=
|
753 |
|
754 |
fillmode_btn.click(
|
755 |
fn = init_next_step,
|
|
|
570 |
label = '{} (1/{})'.format(tpl_name, stage1_info["step3"]["totalNum"])
|
571 |
|
572 |
tpl_idx = channel_info["templateDict"][tpl_name]["index"]
|
573 |
+
value = stage1_info["mappingResults"][0]["newOrder"][tpl_idx]
|
574 |
+
value = [channel_info["inputOrder"][i] for i in value]
|
575 |
|
576 |
stage1_info["state"] = "step3-2-selecting"
|
577 |
# determine which button to display
|
|
|
581 |
in_fillmode : gr.Dropdown(visible=False),
|
582 |
fillmode_btn : gr.Button(visible=False),
|
583 |
chkbox_group : gr.CheckboxGroup(choices=channel_info["inputOrder"],
|
584 |
+
value=value, label=label, visible=True),
|
585 |
next_btn : gr.Button(visible=True)}
|
586 |
else:
|
587 |
yield {stage1_json : stage1_info,
|
|
|
589 |
in_fillmode : gr.Dropdown(visible=False),
|
590 |
fillmode_btn : gr.Button(visible=False),
|
591 |
chkbox_group : gr.CheckboxGroup(choices=channel_info["inputOrder"],
|
592 |
+
value=alue, label=label, visible=True),
|
593 |
step3_btn : gr.Button(visible=True)}
|
594 |
|
595 |
# =======================================step3-2========================================
|
|
|
737 |
label = '{} ({}/{})'.format(tpl_name, step3["count"], step3["totalNum"])
|
738 |
|
739 |
tpl_idx = channel_info["templateDict"][tpl_name]["index"]
|
740 |
+
value = stage1_info["mappingResults"][0]["newOrder"][tpl_idx]
|
741 |
+
value = [channel_info["inputOrder"][i] for i in value]
|
742 |
|
743 |
stage1_info["step3"] = step3
|
744 |
# determine which button to display
|
745 |
if step3["count"] == step3["totalNum"]:
|
746 |
return {stage1_json : stage1_info,
|
747 |
+
chkbox_group : gr.CheckboxGroup(value=value, label=label),
|
748 |
step3_btn : gr.Button(visible=False),
|
749 |
next_btn : gr.Button(visible=True)}
|
750 |
else:
|
751 |
return {stage1_json : stage1_info,
|
752 |
+
chkbox_group : gr.CheckboxGroup(value=value, label=label)}
|
753 |
|
754 |
fillmode_btn.click(
|
755 |
fn = init_next_step,
|