-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding inference support for next logit probability. #78
Conversation
src/lema/infer_prob.py
Outdated
for acceptable_logit in acceptable_logits_enc: | ||
acceptable_logit_prob = next_logit_probs[acceptable_logit] | ||
acceptable_logit_probs.append( | ||
acceptable_logit_prob.detach().cpu().numpy().item() |
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'd recommend using the inference_mode
or no_grad
decorator. That'll avoid the need to manually detach + inference will be faster
I also just noticed that we do not set the model.eval()
in our inference scripts, we should add that as well
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.
no_grad : Done.
model.eval() in our inference scripts --> can you elaborate?
OPE-35 Add in-training evaluation options
HuggingFace trainers already support evaluation every N training steps. The goal of this task is to enable configuring a list of datasets to evaluate intermediate checkpoints. |
Contributes to OPE-35