-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing audio dataset value throws Format not recognised error #7276
Comments
Hi ! can you try if this works ? import soundfile as sf
with open('C:\\Users\\Nawaz-Server\\.cache\\huggingface\\hub\\datasets--fawazahmed0--bug-audio\\snapshots\\fab1398431fed1c0a2a7bff0945465bab8b5daef\\data\\Ghamadi\\037136.mp3', 'rb') as f:
print(sf.read(f)) |
1 task
@lhoestq Same error, here is the output: (mypy) C:\Users\Nawaz-Server\Documents\ml>python myest.py
Traceback (most recent call last):
File "C:\Users\Nawaz-Server\Documents\ml\myest.py", line 5, in <module>
print(sf.read(f))
^^^^^^^^^^
File "C:\Users\Nawaz-Server\.conda\envs\mypy\Lib\site-packages\soundfile.py", line 285, in read
with SoundFile(file, 'r', samplerate, channels,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Nawaz-Server\.conda\envs\mypy\Lib\site-packages\soundfile.py", line 658, in __init__
self._file = self._open(file, mode_int, closefd)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Nawaz-Server\.conda\envs\mypy\Lib\site-packages\soundfile.py", line 1216, in _open
raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name))
soundfile.LibsndfileError: Error opening <_io.BufferedReader name='C:\\Users\\Nawaz-Server\\.cache\\huggingface\\hub\\datasets--fawazahmed0--bug-audio\\snapshots\\fab1398431fed1c0a2a7bff0945465bab8b5daef\\data\\Ghamadi\\037136.mp3'>: Format not recognised.
|
upstream bug: bastibe/python-soundfile#439 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Accessing audio dataset value throws
Format not recognised error
Steps to reproduce the bug
code:
output:
Expected behavior
Everything should work fine, as loading the problematic audio file directly with soundfile package works fine
code:
output:
Environment info
datasets
version: 3.0.2huggingface_hub
version: 0.26.2fsspec
version: 2024.10.0The text was updated successfully, but these errors were encountered: