Skip to content

Commit

Permalink
[LIGHT] Who Am I - Preventing doubleloading model (facebookresearch#4742
Browse files Browse the repository at this point in the history
)
  • Loading branch information
JackUrb authored Aug 15, 2022
1 parent 59ec67c commit c17f8ed
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions projects/light_whoami/agents/pacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ def add_cmdline_args(
def __init__(self, opt: Opt, shared=None):
super().__init__(opt, shared)
reranker_class = self.get_partial_only_reranker_class()
if not (shared and 'classifier' in shared):
self.classifier = reranker_class(opt)
else:
if shared and 'classifier' in shared:
self.classifier = shared['classifier']
elif shared and 'reranker' in shared:
self.classifier = shared['reranker']
elif hasattr(self, 'reranker'):
self.classifier = self.reranker
else:
self.classifier = reranker_class(opt)
assert opt[
'beam_block_full_context'
], 'must set --beam-block-full-context True to use PACER'
Expand Down

0 comments on commit c17f8ed

Please sign in to comment.