Skip to content

Commit d27cdb1

Browse files
author
The TensorFlow Datasets Authors
committed
Add binary to the list of supported types for HuggingFace datasets.
PiperOrigin-RevId: 642308107
1 parent 812e8a9 commit d27cdb1

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tensorflow_datasets/core/utils/huggingface_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
'large_string': np.object_,
4141
'utf8': np.object_,
4242
'string': np.object_,
43+
'binary': np.bytes_,
4344
})
4445
_IMAGE_ENCODING_FORMAT = 'png'
4546
_DEFAULT_IMG = b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01\x08\x02\x00\x00\x00\x90wS\xde\x00\x00\x00\x0cIDATx\x9cc```\x00\x00\x00\x04\x00\x01\xf6\x178U\x00\x00\x00\x00IEND\xaeB`\x82'

tensorflow_datasets/core/utils/huggingface_utils_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def test_convert_to_np_dtype_raises():
4040
('large_string', np.object_),
4141
('utf8', np.object_),
4242
('string', np.object_),
43+
('binary', np.bytes_),
4344
# from np
4445
('bool_', np.bool_),
4546
('int32', np.int32),

0 commit comments

Comments
 (0)