-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
parlai/core/torch_generator_agent.py
Outdated
@@ -1777,7 +1817,7 @@ def __init__(self, *args, **kwargs): | |||
raise ValueError('Greedy search can only be run with beam size 1.') | |||
|
|||
def select_paths(self, logprobs, prior_scores, current_length) -> _PathSelection: | |||
tok_scores, tok_ids = logprobs.max(1) | |||
tok_scores, tok_ids = logprobs |
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.
I don't know this code well. I don't understand why did you have to change this part? isn't this for greedy? And I don't find any indication that the general code was changed to justify changing this part.
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.
good catch, this is an artifact, will fix
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.
Seems good to me. Thanks for adding.
device=device, | ||
verbose=verbose, | ||
dict=self.dict, | ||
) |
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.
is gpu_beam_blocking
needed as in other sampling methods?
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.
yes, will add thanks
Patch description
Factual nucleus is a decoding method that decays the nucleus sampling
p
value over time according to a constant factorlambda_decay
. Thep
value resets when encountering a full-stop (whenp_reset
isTrue
), and there is a lower bound ofomega_bound
to whatp
can decay to.Testing steps
Added Factual Nucleus to the existing tree search tests.