huggingface / huggingface/audio-transformers-course
No such file or directory in chapter1-preprocessing when trying to calculate durations
- Dominant language
- MDX
- Stars
- 521
- Forks
- 155
- Avg merge
- 6m
- Merged PRs (30d)
- 1
Description
Hey
I am not sure what the expected behaviour is and whether its my mistake, an error in the course or of the utilised dataset but I noticed the following in Chapter 1 - Preprocessing:
When I follow the course and try to execute
```
# use librosa to get example's duration from the audio file
new_column = [librosa.get_duration(path=x) for x in minds["path"]]
```
it will fail because the path, or `x` in the code snippet, looks something like `/storage/hf-datasets-cache/all/datasets/27907695716030-config-parquet-and-info-PolyAI-minds14-941a5af2/downloads/extracted/a87e442545495cdb67dfdcbc9d4f35d234c9f8e471449b2db58d7c81b62f001a/en-AU~PAY_BILL/response_4.wav` (which is the exact content as provided by the unmodified dataset as can be seen on the [datasets page](https://huggingface.co/datasets/PolyAI/minds14/viewer/en-AU?row=0) but does not exist on my machine).
Do I use the load_dataset function in a wrong way? Do I have to specify a path to explicitly save or cache the data somewhere? Is there a way that will automatically replace the `'path'` value in the dataset with the local path on my machine?
Alternatively, one could change the function call of `librosa.get_duration(path=x)` and pass the audio array and the sampling_rate instead, e.g.
```
new_column = [librosa.get_duration(y=x["array"], sr=x["sampling_rate"]) for x in minds["audio"]]
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Chapter 1 - Preprocessing example and inspect how load_dataset populates minds["path"] and minds["audio"] for PolyAI/minds14. Reproduce the librosa.get_duration(path=x) failure, then verify the documented approach against the locally available audio data. Done means the course example works locally or clearly explains the required cache-path behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100