Skip to content

Commit

Permalink
Implement icefall ASR model in ART. Signed-off-by: Henry Li Xinyuan <…
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinyuan Li committed Dec 22, 2023
1 parent 337a15f commit e3aac52
Show file tree
Hide file tree
Showing 5 changed files with 872 additions and 6 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/ci-icefall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI PyTorchIcefall
on:
# on manual trigger
workflow_dispatch:

# on pull requests
pull_request:
paths-ignore:
- '*.md'

# on merge queue
merge_group:

# when pushing to main or dev branches
push:
branches:
- main
- dev*

# scheduled CI flow daily
schedule:
- cron: '0 8 * * 0'

jobs:
test_icefall:
name: PyTorchIcefall
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
apt-get update \
&& apt-get install -y \
libgl1-mesa-glx \
libx11-xcb1 \
git \
gcc \
mono-mcs \
libavcodec-extra \
ffmpeg \
curl \
libsndfile-dev \
libsndfile1 \
&& apt-get clean all \
&& rm -r /var/lib/apt/lists/*
pip install astropy
pip install matplotlib
pip install pandas
pip install -U scikit-learn
pip install -u scikit-image
pip install torch==2.0.1+cpu -f https://download.pytorch.org/whl/torch_stable.html
pip install torchaudio
pip install k2==1.24.3.dev20230726+cpu.torch2.0.1 -f https://k2-fsa.github.io/k2/cpu.html
pip install lhotse
git clone https://github.com/HSTEHSTEHSTE/icefall_st.git
cd icefall_st
git checkout slu
pip install -r requirements.txt
pip install pytest
pip install pytest-cov
pip install kaldiio
pip install tensorflow
- name: Test Action
run: |
cd icefall_st/egs/slu/
export PYTHONPATH=$PYTHONPATH:$(pwd)
pytest --cov-report=xml --cov=art --cov-append -q -vv ../../../tests/estimators/speech_recognition/test_pytorch_icefall.py --framework=pytorch --durations=0
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class ProjectedGradientDescentPyTorch(ProjectedGradientDescentCommon):
| Paper link: https://arxiv.org/abs/1706.06083
"""

_estimator_requirements = (BaseEstimator, LossGradientsMixin, ClassifierMixin) # type: ignore
_estimator_requirements = (BaseEstimator, LossGradientsMixin) # type: ignore

def __init__(
self,
estimator: Union["PyTorchClassifier"],
estimator: BaseEstimator,
norm: Union[int, float, str] = np.inf,
eps: Union[int, float, np.ndarray] = 0.3,
eps_step: Union[int, float, np.ndarray] = 0.1,
Expand Down Expand Up @@ -99,10 +99,10 @@ def __init__(
‘runs/exp1’, ‘runs/exp2’, etc. for each new experiment to compare across them.
:param verbose: Show progress bars.
"""
if not estimator.all_framework_preprocessing:
raise NotImplementedError(
"The framework-specific implementation only supports framework-specific preprocessing."
)
# if not estimator.all_framework_preprocessing:
# raise NotImplementedError(
# "The framework-specific implementation only supports framework-specific preprocessing."
# )

if summary_writer and num_random_init > 1:
raise ValueError("TensorBoard is not yet supported for more than 1 random restart (num_random_init>1).")
Expand Down
Loading

0 comments on commit e3aac52

Please sign in to comment.