Skip to content

Commit

Permalink
This is to avoid this code breaking against forthcoming version 1.0 o…
Browse files Browse the repository at this point in the history
…f librosa. Old code caused warning message: FutureWarning: get_duration() keyword argument 'filename' has been renamed to 'path' in version 0.10.0.

    This alias will be removed in version 1.0.
  new_column = [librosa.get_duration(filename=x) for x in minds["path"]]
it should be: new_column = [librosa.get_duration(path=x) for x in minds["path"]]
  • Loading branch information
ptah23 committed Jun 28, 2023
1 parent 0245987 commit ac81306
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/en/chapter1/preprocessing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dataset. However, we can create one, filter based on the values in that column,

```py
# use librosa to get example's duration from the audio file
new_column = [librosa.get_duration(filename=x) for x in minds["path"]]
new_column = [librosa.get_duration(path=x) for x in minds["path"]]
minds = minds.add_column("duration", new_column)

# use 🤗 Datasets' `filter` method to apply the filtering function
Expand Down

0 comments on commit ac81306

Please sign in to comment.