-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds adapter support for the Whisper model from openai and builds upon work done previously in #572. Key Additions: 1. Adapter Support for Whisper Model: - Incorporates adapter functionality to enhance the flexibility and adaptability of the Whisper model. 2. Enhanced Head Functions: - Expanded the argument options for some heads by adding a layer argument with a default value. 3. Preprocessing Scripts for Audio Datasets: - Added preprocessing scripts tailored for audio datasets. - These scripts are now utilized in the Whisper tests within the test suite, replacing the use of arbitrary samples. --------- Co-authored-by: Leon Engländer <[email protected]> Co-authored-by: calpt <[email protected]>
- Loading branch information
1 parent
aea6c09
commit a99e47c
Showing
42 changed files
with
1,637 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Whisper | ||
----------------------------------------------------------------------------------------------------------------------- | ||
|
||
The Whisper model was presented in `Robust Speech Recognition via Large-Scale Weak Supervision | ||
<https://arxiv.org/abs/2212.04356>`_ by Alec Radford, Jong Wook Kim, Tao Xu, Greg Brockman, Christine | ||
McLeavey, Ilya Sutskever. | ||
|
||
Whisper is a state-of-the-art speech recognition model trained on 680,000 hours of multilingual and multitask data, presented by OpenAI. | ||
|
||
The abstract from the paper is the following: | ||
|
||
*We study the capabilities of speech processing systems trained simply to predict large amounts of | ||
transcripts of audio on the internet. When scaled to 680,000 hours of multilingual and multitask | ||
supervision, the resulting models generalize well to standard benchmarks and are often competitive | ||
with prior fully supervised results but in a zeroshot transfer setting without the need for any finetuning. When compared to humans, the models | ||
approach their accuracy and robustness. We are releasing models and inference code to serve as | ||
a foundation for further work on robust speech processing.* | ||
|
||
|
||
WhisperAdapterModel | ||
~~~~~~~~~~~~~~~~~~~~ | ||
|
||
.. autoclass:: adapters.WhisperAdapterModel | ||
:members: | ||
:inherited-members: WhisperPreTrainedModel |
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
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 |
---|---|---|
|
@@ -139,6 +139,7 @@ def __init__( | |
"llama", | ||
"mistral", | ||
"electra", | ||
"whisper", | ||
"xmod", | ||
], | ||
} | ||
|
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
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
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
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,39 @@ | ||
# flake8: noqa | ||
# There's no way to ignore "F401 '...' imported but unused" warnings in this | ||
# module, but to preserve other warnings. So, don't check this module at all. | ||
|
||
# Copyright 2020 The Adapter-Hub Team. 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. | ||
|
||
from typing import TYPE_CHECKING | ||
|
||
from transformers.utils import _LazyModule | ||
|
||
|
||
_import_structure = { | ||
"adapter_model": ["WhisperAdapterModel"], | ||
} | ||
|
||
|
||
if TYPE_CHECKING: | ||
from .adapter_model import WhisperAdapterModel | ||
|
||
else: | ||
import sys | ||
|
||
sys.modules[__name__] = _LazyModule( | ||
__name__, | ||
globals()["__file__"], | ||
_import_structure, | ||
) |
Oops, something went wrong.