-
Notifications
You must be signed in to change notification settings - Fork 16
Fix max allowed lengths for prompts larger than 4096 #74
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Antoni Viros i Martin <aviros@ibm.com>
Signed-off-by: Antoni Viros i Martin <aviros@ibm.com>
aiu_fms_testing_utils/utils/paged.py
Outdated
@@ -27,6 +27,7 @@ def adjust_inputs_to_batch(input_ids: torch.Tensor, **extra_kwargs): | |||
def generate( | |||
model: Union[Callable, torch.nn.Module], | |||
input_ids: torch.Tensor, | |||
max_seq_len: int = 4096, |
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.
Do we anticipate this getting used? or is it just a placeholder to grab the max_seq_len param if passed to fms generate?
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.
this is to match the signature between both generate() calls and avoid errors yes
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.
We may just want this to be part of the attention_specific_kwargs in the inference and warmup
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.
done
@@ -53,6 +53,7 @@ def warmup_model( | |||
generate( | |||
model, | |||
_warmup_input_ids, | |||
max_seq_len=_warmup_input_ids.shape[1] + max_new_tokens, |
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.
could we just add this to the attention_specific_kwargs
in line 32? this way we don't need to change the signature of paged generate.
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.
done
Signed-off-by: Antoni Viros i Martin <aviros@ibm.com>
Signed-off-by: Antoni Viros i Martin <aviros@ibm.com>
Signed-off-by: Antoni Viros i Martin <aviros@ibm.com>
This takes cares of an oversight that prevented prompts longer than 4k from being run with generate()