Reformat code style with black.

This commit is contained in:
pkufool 2021-08-23 09:32:38 +08:00
parent 8c75c0abeb
commit f2a9e69223
4 changed files with 24 additions and 5 deletions

View File

@ -1,7 +1,20 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# Copyright (c) 2021 University of Chinese Academy of Sciences (author: Han Zhu) # 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 math
import warnings import warnings

View File

@ -70,7 +70,8 @@ def compute_fbank_librispeech():
continue continue
logging.info(f"Processing {partition}") logging.info(f"Processing {partition}")
cut_set = CutSet.from_manifests( cut_set = CutSet.from_manifests(
recordings=m["recordings"], supervisions=m["supervisions"], recordings=m["recordings"],
supervisions=m["supervisions"],
) )
if "train" in partition: if "train" in partition:
cut_set = ( cut_set = (

View File

@ -74,7 +74,9 @@ class BpeCtcTrainingGraphCompiler(object):
return self.sp.encode(texts, out_type=int) return self.sp.encode(texts, out_type=int)
def compile( def compile(
self, piece_ids: List[List[int]], modified: bool = False, self,
piece_ids: List[List[int]],
modified: bool = False,
) -> k2.Fsa: ) -> k2.Fsa:
"""Build a ctc graph from a list-of-list piece IDs. """Build a ctc graph from a list-of-list piece IDs.

View File

@ -25,7 +25,10 @@ from icefall.lexicon import Lexicon
class CtcTrainingGraphCompiler(object): class CtcTrainingGraphCompiler(object):
def __init__( def __init__(
self, lexicon: Lexicon, device: torch.device, oov: str = "<UNK>", self,
lexicon: Lexicon,
device: torch.device,
oov: str = "<UNK>",
): ):
""" """
Args: Args: