mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-12 19:42:19 +00:00
Reformat code style with black.
This commit is contained in:
parent
8c75c0abeb
commit
f2a9e69223
@ -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
|
||||
|
@ -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 = (
|
||||
|
@ -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.
|
||||
|
||||
|
@ -25,7 +25,10 @@ from icefall.lexicon import Lexicon
|
||||
|
||||
class CtcTrainingGraphCompiler(object):
|
||||
def __init__(
|
||||
self, lexicon: Lexicon, device: torch.device, oov: str = "<UNK>",
|
||||
self,
|
||||
lexicon: Lexicon,
|
||||
device: torch.device,
|
||||
oov: str = "<UNK>",
|
||||
):
|
||||
"""
|
||||
Args:
|
||||
|
Loading…
x
Reference in New Issue
Block a user