Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ASR] support wav2vec2 command line and demo #2658

Merged
merged 12 commits into from
Nov 21, 2022
Merged
Prev Previous commit
Next Next commit
wav2vec2 demo update: support different optimizer and lr_schedular, a…
…lign mdoel, update input type, test=asr
Zth9730 committed Nov 17, 2022
commit 3adb310a1cafb0be1e104aad35491893bbb4e06f
20 changes: 16 additions & 4 deletions paddlespeech/s2t/models/wav2vec2/modules/VanillaNN.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
"""Vanilla Neural Network for simple tests.
Authors
* Elena Rastorgueva 2020
"""
# Authors
# * Elena Rastorgueva 2020
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# 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.
# Modified from speechbrain(https://github.com/speechbrain/speechbrain/blob/develop/speechbrain/lobes/models/VanillaNN.py).
import paddle

from paddlespeech.s2t.models.wav2vec2.modules import containers
22 changes: 17 additions & 5 deletions paddlespeech/s2t/models/wav2vec2/modules/linear.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
"""Library implementing linear transformation.
Authors
* Mirco Ravanelli 2020
* Davide Borra 2021
"""
# Authors
# * Mirco Ravanelli 2020
# * Davide Borra 2021
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# 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.
# Modified from speechbrain(https://github.com/speechbrain/speechbrain/blob/develop/speechbrain/nnet/linear.py).
import logging

import paddle