mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-11 11:02:29 +00:00
fix formatting issues
This commit is contained in:
parent
563292599b
commit
814d3ac702
@ -22,13 +22,15 @@ Usage:
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import pdb
|
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import math
|
import math
|
||||||
|
import os
|
||||||
|
import pdb
|
||||||
|
|
||||||
|
# import subprocess as sp
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Optional, Tuple
|
from typing import Dict, List, Optional, Tuple
|
||||||
from tokenizer import Tokenizer
|
|
||||||
|
|
||||||
import k2
|
import k2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
@ -42,6 +44,7 @@ from streaming_beam_search import (
|
|||||||
greedy_search,
|
greedy_search,
|
||||||
modified_beam_search,
|
modified_beam_search,
|
||||||
)
|
)
|
||||||
|
from tokenizer import Tokenizer
|
||||||
from torch import Tensor, nn
|
from torch import Tensor, nn
|
||||||
from torch.nn.utils.rnn import pad_sequence
|
from torch.nn.utils.rnn import pad_sequence
|
||||||
from train import add_model_arguments, get_model, get_params
|
from train import add_model_arguments, get_model, get_params
|
||||||
@ -61,9 +64,6 @@ from icefall.utils import (
|
|||||||
write_error_stats,
|
write_error_stats,
|
||||||
)
|
)
|
||||||
|
|
||||||
import subprocess as sp
|
|
||||||
import os
|
|
||||||
|
|
||||||
LOG_EPS = math.log(1e-10)
|
LOG_EPS = math.log(1e-10)
|
||||||
|
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ def decode_one_chunk(
|
|||||||
decode_streams[i].states = states[i]
|
decode_streams[i].states = states[i]
|
||||||
decode_streams[i].done_frames += encoder_out_lens[i]
|
decode_streams[i].done_frames += encoder_out_lens[i]
|
||||||
# if decode_streams[i].done:
|
# if decode_streams[i].done:
|
||||||
# finished_streams.append(i)
|
# finished_streams.append(i)
|
||||||
finished_streams.append(i)
|
finished_streams.append(i)
|
||||||
|
|
||||||
return finished_streams
|
return finished_streams
|
||||||
@ -633,7 +633,6 @@ def decode_dataset(
|
|||||||
print("No finished streams, breaking the loop")
|
print("No finished streams, breaking the loop")
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
for i in sorted(finished_streams, reverse=True):
|
for i in sorted(finished_streams, reverse=True):
|
||||||
try:
|
try:
|
||||||
decode_results.append(
|
decode_results.append(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user