Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 15 additions & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,21 @@ jobs:
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install packages
run: sudo apt update; sudo apt install -y libicu-dev ffmpeg libavcodec-extra libsndfile1 llvm
run: sudo apt update; sudo apt install -y libicu-dev ffmpeg libavcodec-extra llvm
- name: Install libsndfile
run: >
sudo apt install -y autoconf autogen automake build-essential libasound2-dev libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev libmpg123-dev pkg-config;
cd /tmp;
git clone https://github.com/libsndfile/libsndfile.git;
cd libsndfile;
git checkout v1.0.30;
./autogen.sh;
./configure --enable-werror;
make;
sudo make install;
sudo ldconfig;
cd;
rm -rf /tmp/libsndfile;
- name: Install dependencies
run: poetry install
- name: Create mongoDB Docker container
Expand Down
19 changes: 18 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,24 @@ BetterUptime:
Install packages, logged as `hf`:

```bash
sudo apt install python-is-python3 make nginx libicu-dev ffmpeg libavcodec-extra libsndfile1
sudo apt install python-is-python3 make nginx libicu-dev ffmpeg libavcodec-extra
```

Also install `libsndfile` in version `v1.0.30`. As the version in ubuntu stable for the moment is `v1.0.28`, we can build from scratch (see details here: https://github.com/libsndfile/libsndfile)

```
sudo apt install -y autoconf autogen automake build-essential libasound2-dev libflac-dev libogg-dev libtool libvorbis-dev libopus-dev libmp3lame-dev libmpg123-dev pkg-config;
cd /tmp;
git clone https://github.com/libsndfile/libsndfile.git;
cd libsndfile;
git checkout v1.0.30;
./autogen.sh;
./configure --enable-werror;
make;
sudo make install;
sudo ldconfig;
cd;
rm -rf /tmp/libsndfile
```

Also install docker (see https://docs.docker.com/engine/install/ubuntu/#install-using-the-repository and https://docs.docker.com/engine/install/linux-postinstall/).
Expand Down
7 changes: 7 additions & 0 deletions tests/models/test_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ def test_audio_dataset() -> None:
rows = get_rows("abidlabs/test-audio-1", "test", "train")
assert len(rows) == 1
assert rows[0]["Output"]["sampling_rate"] == 48000


def test_libsndfile() -> None:
# see https://github.com/huggingface/datasets-preview-backend/issues/194
rows = get_rows("polinaeterna/ml_spoken_words", "ar", "train")
assert len(rows) == ROWS_MAX_NUMBER
assert rows[0]["audio"]["sampling_rate"] == 48000