Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[LIGHT] Who Am I - Preventing doubleloading model #4742

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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