-
Notifications
You must be signed in to change notification settings - Fork 517
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
Remove batched generation support #162
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.
Looks good, thanks @carmocca!
We can always add a separate script supporting batch generation in the future.
# if the sequence context is growing too long we must crop it at max_seq_length | ||
idx_cond = idx_cond if T <= max_seq_length else idx_cond[:, -max_seq_length:] | ||
idx_cond = idx_cond if T <= max_seq_length else idx_cond[-max_seq_length:] | ||
|
||
# forward | ||
logits = model(idx_cond) |
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.
The model still expects a batch, so the input tensor needs to be expanded here.
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. Merged too hastily, sorry about that
Unblocks #153
Closes #49