-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Support macOS. * Remove extra files. * Minor fixes. * Minor fixes. * fix an error. * Fix building pip packages on macOS. * Fix test errors. * Release v1.4. * Fix test errors.
- Loading branch information
1 parent
d27b45b
commit 7b2702d
Showing
13 changed files
with
251 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Copyright 2021 Xiaomi Corp. (author: Fangjun Kuang) | ||
|
||
# See ../../LICENSE for clarification regarding multiple authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
run_tests: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-18.04, macos-10.15] | ||
cuda: ["10.1"] | ||
torch: ["1.8.1"] | ||
python-version: [3.6, 3.7, 3.8] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install GCC 7 | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
sudo apt-get install -y gcc-7 g++-7 | ||
echo "CC=/usr/bin/gcc-7" >> $GITHUB_ENV | ||
echo "CXX=/usr/bin/g++-7" >> $GITHUB_ENV | ||
- name: Install CUDA Toolkit ${{ matrix.cuda }} | ||
if: startsWith(matrix.os, 'ubuntu') | ||
shell: bash | ||
env: | ||
cuda: ${{ matrix.cuda }} | ||
run: | | ||
source ./scripts/github_actions/install_cuda.sh | ||
echo "CUDA_HOME=${CUDA_HOME}" >> $GITHUB_ENV | ||
echo "${CUDA_HOME}/bin" >> $GITHUB_PATH | ||
echo "LD_LIBRARY_PATH=${CUDA_HOME}/lib:${CUDA_HOME}/lib64:${LD_LIBRARY_PATH}" >> $GITHUB_ENV | ||
- name: Display NVCC version | ||
if: startsWith(matrix.os, 'ubuntu') | ||
run: | | ||
which nvcc | ||
nvcc --version | ||
- name: Install PyTorch ${{ matrix.torch }} | ||
if: startsWith(matrix.os, 'ubuntu') | ||
env: | ||
cuda: ${{ matrix.cuda }} | ||
torch: ${{ matrix.torch }} | ||
shell: bash | ||
run: | | ||
sudo apt update | ||
sudo apt install libsndfile1-dev libsndfile1 ffmpeg | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install wheel twine typing_extensions soundfile | ||
python3 -m pip install bs4 requests tqdm | ||
./scripts/github_actions/install_torch.sh | ||
python3 -c "import torch; print('torch version:', torch.__version__)" | ||
- name: Install PyTorch ${{ matrix.torch }} | ||
if: startsWith(matrix.os, 'macos') | ||
shell: bash | ||
run: | | ||
python3 -m pip install -qq --upgrade pip | ||
python3 -m pip install -qq wheel twine typing_extensions soundfile | ||
python3 -m pip install -qq torch==${{ matrix.torch }} | ||
python3 -c "import torch; print('torch version:', torch.__version__)" | ||
- name: Download cudnn 8.0 | ||
if: startsWith(matrix.os, 'ubuntu') | ||
env: | ||
cuda: ${{ matrix.cuda }} | ||
run: | | ||
./scripts/github_actions/install_cudnn.sh | ||
- name: Build | ||
shell: bash | ||
run: | | ||
mkdir build_release | ||
cd build_release | ||
cmake .. | ||
make VERBOSE=1 | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
cd build_release | ||
ctest -R py --output-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright 2021 Fangjun Kuang ([email protected]) | ||
|
||
# See ../../LICENSE for clarification regarding multiple authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: style_check | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
style_check: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-18.04, macos-10.15] | ||
python-version: [3.7, 3.9] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip black flake8 | ||
- name: Run flake8 | ||
shell: bash | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --show-source --statistics | ||
flake8 . | ||
- name: Run black | ||
shell: bash | ||
working-directory: ${{github.workspace}} | ||
run: | | ||
black --check --diff . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
# kaldifeat | ||
|
||
<div align="center"> | ||
<img src="/doc/source/images/os.svg"> | ||
</div> | ||
|
||
|
||
<sub> | ||
<table> | ||
<tr> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
add_subdirectory(csrc) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function(kaldifeat_add_py_test source) | ||
get_filename_component(name ${source} NAME_WE) | ||
set(name "${name}_py") | ||
|
||
add_test(NAME ${name} | ||
COMMAND | ||
"${PYTHON_EXECUTABLE}" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/${source}" | ||
) | ||
|
||
get_filename_component(kaldifeat_path ${CMAKE_CURRENT_LIST_DIR} DIRECTORY) | ||
|
||
set_property(TEST ${name} | ||
PROPERTY ENVIRONMENT "PYTHONPATH=${kaldifeat_path}:$<TARGET_FILE_DIR:_kaldifeat>:$ENV{PYTHONPATH}" | ||
) | ||
endfunction() | ||
|
||
# please sort the files in alphabetic order | ||
set(py_test_files | ||
test_fbank.py | ||
test_mfcc.py | ||
test_plp.py | ||
test_spectrogram.py | ||
test_options.py | ||
) | ||
|
||
foreach(source IN LISTS py_test_files) | ||
kaldifeat_add_py_test(${source}) | ||
endforeach() |