diff --git a/tensorrt_llm/llmapi/llm.py b/tensorrt_llm/llmapi/llm.py index 4521cf482..20222935a 100644 --- a/tensorrt_llm/llmapi/llm.py +++ b/tensorrt_llm/llmapi/llm.py @@ -340,7 +340,8 @@ def _prepare_sampling_params( raise ValueError( "tokenizer is required to reset end_id if it is None, or you can explicitly specify the end_id for sampling_params" ) - return sampling_params.setup(self.tokenizer) + sampling_params.setup(self.tokenizer) + return sampling_params else: raise TypeError( f"The sampling_params must be type SamplingParams or None, but got {type(sampling_params)}"