Spaces:
Running
Running
inoki-giskard
commited on
Commit
•
afd881d
1
Parent(s):
1afc3d2
Fix label mapping
Browse files
text_classification_ui_helpers.py
CHANGED
@@ -183,7 +183,9 @@ def try_submit(m_id, d_id, config, split, local, uid):
|
|
183 |
if "labels" not in all_mappings.keys():
|
184 |
gr.Warning(CONFIRM_MAPPING_DETAILS_FAIL_RAW)
|
185 |
return (gr.update(interactive=True), gr.update(visible=False))
|
186 |
-
label_mapping =
|
|
|
|
|
187 |
|
188 |
if "features" not in all_mappings.keys():
|
189 |
gr.Warning(CONFIRM_MAPPING_DETAILS_FAIL_RAW)
|
|
|
183 |
if "labels" not in all_mappings.keys():
|
184 |
gr.Warning(CONFIRM_MAPPING_DETAILS_FAIL_RAW)
|
185 |
return (gr.update(interactive=True), gr.update(visible=False))
|
186 |
+
label_mapping = {}
|
187 |
+
for i, label in zip(range(len(all_mappings["labels"].keys())), all_mappings["labels"].keys()):
|
188 |
+
label_mapping.update({str(i): label})
|
189 |
|
190 |
if "features" not in all_mappings.keys():
|
191 |
gr.Warning(CONFIRM_MAPPING_DETAILS_FAIL_RAW)
|