-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[BlenderBot2] A hybrid mode (skip search when needed) #4221
Conversation
@@ -181,7 +181,7 @@ def __init__(self, opt: Opt): | |||
) | |||
assert isinstance(base_agent, TorchAgent) | |||
self.agents = [base_agent] | |||
bsz = max(opt.get('batchsize', 1), opt.get('eval_batchsize', 1)) | |||
bsz = max(opt.get('batchsize') or 1, opt.get('eval_batchsize') or 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm interesting, I thought anything return from opt.get(XXX, 1) would never be None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be None
if the arg is in opt
but no value is given
@@ -894,6 +914,13 @@ def build_model(self) -> Union[BlenderBot2FidModel, T5BlenderBot2FidModel]: | |||
return model | |||
|
|||
|
|||
class BlenderBot2SearchQueryFiDAgent(BlenderBot2FidAgent): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool, looks good to me!
yield message, episode_started | ||
|
||
|
||
class WizardDialogGoldKnowledgeTeacher(WizardDialogTeacher): | ||
def __init__(self, opt, shared=None): | ||
super().__init__(opt, shared=shared) | ||
self.id = 'WizardDialogGoldKnowledgeTeacher' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks for adding this, otherwise the train_model
always flags this red warning ;)
teacher tests seem to pass now! thanks god will merge it. |
Patch description
Pass a new batch field
skip_search
to classify_retrieval: to skip search if that field is true.This can be useful for example, when gold knowledge is prepended to the text.
Testing steps
Other information