Skip to content

Commit 6b40167

Browse files
committed
fix: Always assign the (possibly to None) lm_gc property
1 parent a68265c commit 6b40167

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

recognition/advanced_tree_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ def __init__(
208208
(
209209
self.config,
210210
self.post_config,
211-
self.lm_gc_job,
212211
) = AdvancedTreeSearchJob.create_config(**kwargs)
213212
self.feature_flow = feature_flow
214213
self.exe = self.select_exe(crp.flf_tool_exe, "flf-tool")
@@ -313,6 +312,7 @@ def specialize_lm_config(crp, lm_config):
313312
).out_lm
314313
for i, lm in enumerate(arpa_lms)
315314
}
315+
lm_gc = None
316316
else:
317317
lm_gc = AdvancedTreeSearchLmImageAndGlobalCacheJob(
318318
crp, lmgc_scorer if lmgc_scorer is not None else feature_scorer, extra_config, extra_post_config
@@ -463,11 +463,11 @@ def specialize_lm_config(crp, lm_config):
463463
config._update(extra_config)
464464
post_config._update(extra_post_config)
465465

466-
return config, post_config
466+
return config, post_config, lm_gc
467467

468468
@classmethod
469469
def hash(cls, kwargs):
470-
config, post_config = cls.create_config(**kwargs)
470+
config, post_config, lm_gc = cls.create_config(**kwargs)
471471
return super().hash(
472472
{
473473
"config": config,

0 commit comments

Comments
 (0)