Spaces:
Running
Running
Commit
·
f8d2118
1
Parent(s):
54410d4
Extract label mappings from table
Browse files
app.py
CHANGED
@@ -160,12 +160,10 @@ def try_validate(m_id, ppl, dataset_id, dataset_config, dataset_split, column_ma
|
|
160 |
|
161 |
def try_submit(m_id, d_id, config, split, column_mappings, local):
|
162 |
label_mapping = {}
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
except Exception:
|
168 |
-
column_mapping = {}
|
169 |
|
170 |
if local:
|
171 |
command = [
|
@@ -180,7 +178,7 @@ def try_submit(m_id, d_id, config, split, column_mappings, local):
|
|
180 |
"--discussion_repo", os.environ.get(HF_REPO_ID) or os.environ.get(HF_SPACE_ID),
|
181 |
"--output_format", "markdown",
|
182 |
"--output_portal", "huggingface",
|
183 |
-
"--feature_mapping", json.dumps(column_mapping),
|
184 |
"--label_mapping", json.dumps(label_mapping),
|
185 |
]
|
186 |
|
|
|
160 |
|
161 |
def try_submit(m_id, d_id, config, split, column_mappings, local):
|
162 |
label_mapping = {}
|
163 |
+
for i, label in column_mappings["Model Prediction Labels"].iteritems():
|
164 |
+
label_mapping.update({str(i): label})
|
165 |
+
|
166 |
+
# TODO: Set column mapping for some dataset such as `amazon_polarity`
|
|
|
|
|
167 |
|
168 |
if local:
|
169 |
command = [
|
|
|
178 |
"--discussion_repo", os.environ.get(HF_REPO_ID) or os.environ.get(HF_SPACE_ID),
|
179 |
"--output_format", "markdown",
|
180 |
"--output_portal", "huggingface",
|
181 |
+
# TODO: "--feature_mapping", json.dumps(column_mapping),
|
182 |
"--label_mapping", json.dumps(label_mapping),
|
183 |
]
|
184 |
|