WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tensorflow_datasets/core/utils/conversion_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def to_tfds_value(value: Any, feature: feature_lib.FeatureConnector) -> Any:
case _:
return [value]
case feature_lib.Audio():
if array := value.get('array'):
array = value.get('array')
if array is not None:
# Hugging Face uses floats, TFDS uses integers.
return [int(sample * feature.sample_rate) for sample in array]
elif (path := value.get('path')) and (path := epath.Path(path)).exists():
Expand Down