mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-04 06:34:20 +00:00
Fix deocde
This commit is contained in:
parent
cba104a29d
commit
a7cb40a0a0
@ -927,9 +927,9 @@ def main():
|
||||
if os.path.exists(params.context_file):
|
||||
contexts = []
|
||||
for line in open(params.context_file).readlines():
|
||||
contexts.append(line.strip())
|
||||
contexts.append((sp.encode(line.strip()), 0.0))
|
||||
context_graph = ContextGraph(params.context_score)
|
||||
context_graph.build(sp.encode(contexts))
|
||||
context_graph.build(contexts)
|
||||
else:
|
||||
context_graph = None
|
||||
else:
|
||||
|
@ -1001,9 +1001,9 @@ def main():
|
||||
if os.path.exists(params.context_file):
|
||||
contexts = []
|
||||
for line in open(params.context_file).readlines():
|
||||
contexts.append(line.strip())
|
||||
contexts.append((sp.encode(line.strip()), 0.0))
|
||||
context_graph = ContextGraph(params.context_score)
|
||||
context_graph.build(sp.encode(contexts))
|
||||
context_graph.build(contexts)
|
||||
else:
|
||||
context_graph = None
|
||||
else:
|
||||
|
@ -868,7 +868,7 @@ def main():
|
||||
contexts_text.append(line.strip())
|
||||
contexts = graph_compiler.texts_to_ids(contexts_text)
|
||||
context_graph = ContextGraph(params.context_score)
|
||||
context_graph.build(contexts)
|
||||
context_graph.build([(c, 0.0) for c in contexts])
|
||||
else:
|
||||
context_graph = None
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user