From e97c9fbdbf47d04a16ce0a8afe007d921c7dfeab Mon Sep 17 00:00:00 2001 From: yaozengwei Date: Fri, 22 Apr 2022 11:04:50 +0800 Subject: [PATCH] Sorted imports for transducer_emformer/streaming_feature_extractor.py --- .../streaming_feature_extractor.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/egs/librispeech/ASR/transducer_emformer/streaming_feature_extractor.py b/egs/librispeech/ASR/transducer_emformer/streaming_feature_extractor.py index c3d9a5675..4d405cad1 100644 --- a/egs/librispeech/ASR/transducer_emformer/streaming_feature_extractor.py +++ b/egs/librispeech/ASR/transducer_emformer/streaming_feature_extractor.py @@ -14,10 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. +from typing import List, Optional + +import torch from beam_search import HypothesisList from kaldifeat import FbankOptions, OnlineFbank, OnlineFeature -from typing import List, Optional -import torch def _create_streaming_feature_extractor() -> OnlineFeature: @@ -41,6 +42,15 @@ def _create_streaming_feature_extractor() -> OnlineFeature: class FeatureExtractionStream(object): def __init__(self, context_size: int, decoding_method: str) -> None: + """ + Args: + context_size: + Context size of the RNN-T decoder model. + decoding_method: + Decoding method. The possible values are: + - greedy_search + - modified_beam_search + """ self.feature_extractor = _create_streaming_feature_extractor() # It contains a list of 1-D tensors representing the feature frames. self.feature_frames: List[torch.Tensor] = []