fix MMI decode graph

This commit is contained in:
PingFeng Luo 2021-12-01 11:22:25 +08:00
parent a54f9a9b41
commit 4b6edaa4a3

View File

@ -39,6 +39,7 @@ from icefall.decode import (
) )
from icefall.env import get_env_info from icefall.env import get_env_info
from icefall.lexicon import Lexicon from icefall.lexicon import Lexicon
from icefall.mmi_graph_compiler import MmiTrainingGraphCompiler
from icefall.utils import ( from icefall.utils import (
AttributeDict, AttributeDict,
get_texts, get_texts,
@ -493,11 +494,12 @@ def main():
logging.info(f"device: {device}") logging.info(f"device: {device}")
graph_compiler = BpeCtcTrainingGraphCompiler( graph_compiler = MmiTrainingGraphCompiler(
params.lang_dir, args.lang_dir,
device=device, device=device,
sos_token="<sos/eos>", oov="<UNK>",
eos_token="<sos/eos>", sos_id=1,
eos_id=1,
) )
sos_id = graph_compiler.sos_id sos_id = graph_compiler.sos_id
eos_id = graph_compiler.eos_id eos_id = graph_compiler.eos_id