From f2a9e69223d74bbb308c06eb8d8f02cac3e91170 Mon Sep 17 00:00:00 2001 From: pkufool Date: Mon, 23 Aug 2021 09:32:38 +0800 Subject: [PATCH] Reformat code style with black. --- egs/librispeech/ASR/conformer_ctc/conformer.py | 17 +++++++++++++++-- .../ASR/local/compute_fbank_librispeech.py | 3 ++- icefall/bpe_graph_compiler.py | 4 +++- icefall/graph_compiler.py | 5 ++++- 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/egs/librispeech/ASR/conformer_ctc/conformer.py b/egs/librispeech/ASR/conformer_ctc/conformer.py index ac08002d3..08287d686 100644 --- a/egs/librispeech/ASR/conformer_ctc/conformer.py +++ b/egs/librispeech/ASR/conformer_ctc/conformer.py @@ -1,7 +1,20 @@ #!/usr/bin/env python3 - # Copyright (c) 2021 University of Chinese Academy of Sciences (author: Han Zhu) -# Apache 2.0 +# +# 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. + import math import warnings diff --git a/egs/librispeech/ASR/local/compute_fbank_librispeech.py b/egs/librispeech/ASR/local/compute_fbank_librispeech.py index 7d253e555..b89d2dfc2 100755 --- a/egs/librispeech/ASR/local/compute_fbank_librispeech.py +++ b/egs/librispeech/ASR/local/compute_fbank_librispeech.py @@ -70,7 +70,8 @@ def compute_fbank_librispeech(): continue logging.info(f"Processing {partition}") cut_set = CutSet.from_manifests( - recordings=m["recordings"], supervisions=m["supervisions"], + recordings=m["recordings"], + supervisions=m["supervisions"], ) if "train" in partition: cut_set = ( diff --git a/icefall/bpe_graph_compiler.py b/icefall/bpe_graph_compiler.py index d85aff1ff..e76b7ea32 100644 --- a/icefall/bpe_graph_compiler.py +++ b/icefall/bpe_graph_compiler.py @@ -74,7 +74,9 @@ class BpeCtcTrainingGraphCompiler(object): return self.sp.encode(texts, out_type=int) def compile( - self, piece_ids: List[List[int]], modified: bool = False, + self, + piece_ids: List[List[int]], + modified: bool = False, ) -> k2.Fsa: """Build a ctc graph from a list-of-list piece IDs. diff --git a/icefall/graph_compiler.py b/icefall/graph_compiler.py index 0ee092176..23ac247e8 100644 --- a/icefall/graph_compiler.py +++ b/icefall/graph_compiler.py @@ -25,7 +25,10 @@ from icefall.lexicon import Lexicon class CtcTrainingGraphCompiler(object): def __init__( - self, lexicon: Lexicon, device: torch.device, oov: str = "", + self, + lexicon: Lexicon, + device: torch.device, + oov: str = "", ): """ Args: