Replies: 1 comment
-
Hi! I've opened a PR that adds a "kernel" to allow this kind of cast. In the meantime, you can perform the cast as follows: def convert_audio_bytes_to_dict(batch):
batch["audio"] = [{"bytes": audio_bytes} for audio_bytes in batch["audio"]]
return batch
# convert the column type from Value("binary") to Audio()
features = ds.features
features = features.copy()
features["audio"] = datasets.Audio()
ds = ds.map(convert_audio_bytes_to_dict, batched=True, features=features) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi ,
I am solving an ASR task, and have my audio files as
byte
strings. How can I cast them using the Audio dataclass (datasets.Audio
)? Thanks!Beta Was this translation helpful? Give feedback.
All reactions