-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
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.
Wow - so fast! Super helpful, thanks :)
parlai/core/torch_generator_agent.py
Outdated
ctxt = batch.text_vec[batch_idx] | ||
if self.beam_block_full_context: | ||
full_ctxt = batch.observations[batch_idx].get('full_text_vec', ctxt) | ||
if not isinstance(full_ctxt, torch.Tensor): |
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 - should it be if not isinstance(full_ctxt, torch.LongTensor):
instead?
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.
sure, it's just a check that it's not a List
; will update
Default is now |
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.
Looks reasonable, thanks!
# from generating ngrams from model's context, which is limited | ||
# by truncation parameters. Now, we block on full dialogue history. | ||
if 'beam_block_full_context' not in opt_from_disk: | ||
opt_from_disk['beam_block_full_context'] = False |
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 should we perhaps print a message about this so that people know?
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.
ok, added
failing test is flaky and gpu tests are still broken; going to merge anyway (everything passed before, and nothing functionally changed besides |
Patch description
Beam search context ngram blocking is currently limited by the text truncation for a given model (e.g. for Blender this is only 128 tokens). I've added a flag to allow context blocking throughout the whole dialogue history.
Testing steps
Added a test
Logs