Skip to content

Conversation

@mfuntowicz
Copy link
Contributor

@mfuntowicz mfuntowicz commented Dec 12, 2024

In the current version of the LLM API code, calling generate with a prefilled sampling_params would cause a potential undefined behaviour if no tokenizer is defined on the LLM instance.

This is because the sampling_params should only be setup in the case end_id == None and self.tokenizer != None. Otherwise we are at risk.

This PR aims to solve this.

@mfuntowicz mfuntowicz changed the title sampling_params should be setup only if end_id is None and tokenizer is not None [LLM] sampling_params should be setup only if end_id is None and tokenizer is not None Dec 12, 2024
@syuoni
Copy link
Collaborator

syuoni commented Dec 13, 2024

Nice catch! Thanks for the contribution.

@nv-guomingz
Copy link
Collaborator

Hi @mfuntowicz thanks for your contribution to TRT-LLM. We've merged your changes into our internal branch for the coming 0.16 release.

@nv-guomingz
Copy link
Collaborator

Close it since this MR's changes have been upstreamed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants