Update files from the datasets library (from 1.6.0)
Browse filesRelease notes: https://github.com/huggingface/datasets/releases/tag/1.6.0
- super_glue.py +2 -5
super_glue.py
CHANGED
|
@@ -16,13 +16,10 @@
|
|
| 16 |
# Lint as: python3
|
| 17 |
"""The SuperGLUE benchmark."""
|
| 18 |
|
| 19 |
-
from __future__ import absolute_import, division, print_function
|
| 20 |
|
| 21 |
import json
|
| 22 |
import os
|
| 23 |
|
| 24 |
-
import six
|
| 25 |
-
|
| 26 |
import datasets
|
| 27 |
|
| 28 |
|
|
@@ -592,11 +589,11 @@ def _fix_wst(ex):
|
|
| 592 |
|
| 593 |
def _cast_label(label):
|
| 594 |
"""Converts the label into the appropriate string version."""
|
| 595 |
-
if isinstance(label,
|
| 596 |
return label
|
| 597 |
elif isinstance(label, bool):
|
| 598 |
return "True" if label else "False"
|
| 599 |
-
elif isinstance(label,
|
| 600 |
assert label in (0, 1)
|
| 601 |
return str(label)
|
| 602 |
else:
|
|
|
|
| 16 |
# Lint as: python3
|
| 17 |
"""The SuperGLUE benchmark."""
|
| 18 |
|
|
|
|
| 19 |
|
| 20 |
import json
|
| 21 |
import os
|
| 22 |
|
|
|
|
|
|
|
| 23 |
import datasets
|
| 24 |
|
| 25 |
|
|
|
|
| 589 |
|
| 590 |
def _cast_label(label):
|
| 591 |
"""Converts the label into the appropriate string version."""
|
| 592 |
+
if isinstance(label, str):
|
| 593 |
return label
|
| 594 |
elif isinstance(label, bool):
|
| 595 |
return "True" if label else "False"
|
| 596 |
+
elif isinstance(label, int):
|
| 597 |
assert label in (0, 1)
|
| 598 |
return str(label)
|
| 599 |
else:
|