Skip to content

Commit 23ad1a7

Browse files
Fix strict_glue_format filename clash (#880)
* Rename namespaces to suppress warnings. * Revert "Rename namespaces to suppress warnings." This reverts commit 0cf7b23. * Initial attempt. * Fix write_strict_glue_format filename clash * Whitespace
1 parent 8582c5c commit 23ad1a7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

config/defaults.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ write_preds = 0 // 0 _or_ comma-separated list of splits (without spaces, optio
204204
// Supported for GLUE tasks and a few others. You should see errors with
205205
// unsupported tasks.
206206
write_strict_glue_format = 0 // If true, write_preds will only write the 'index' and 'prediction'
207-
// columns for GLUE tasks, and will use the filenames expected by
208-
// the GLUE evaluation server.
207+
// columns for GLUE/SuperGLUE tasks, and will use the test filenames
208+
// expected by the GLUE evaluation server.
209209

210210

211211
// Preprocessing //

jiant/evaluate.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,15 @@ def write_preds(
246246

247247
def _get_pred_filename(task_name, pred_dir, split_name, strict_glue_format):
248248
if strict_glue_format and task_name in GLUE_NAME_MAP:
249-
file = GLUE_NAME_MAP[task_name] + ".tsv"
249+
if split_name == "test":
250+
file = "%s.tsv" % (GLUE_NAME_MAP[task_name])
251+
else:
252+
file = "%s_%s.tsv" % (GLUE_NAME_MAP[task_name], split_name)
250253
elif strict_glue_format and task_name in SUPERGLUE_NAME_MAP:
251-
file = SUPERGLUE_NAME_MAP[task_name] + ".jsonl"
254+
if split_name == "test":
255+
file = "%s.jsonl" % (SUPERGLUE_NAME_MAP[task_name])
256+
else:
257+
file = "%s_%s.jsonl" % (SUPERGLUE_NAME_MAP[task_name], split_name)
252258
else:
253259
file = "%s_%s.tsv" % (task_name, split_name)
254260
return os.path.join(pred_dir, file)

0 commit comments

Comments
 (0)