Skip to content

Commit dceb34a

Browse files
committed
address comment
Signed-off-by: leslie-fang25 <[email protected]>
1 parent c5e68a6 commit dceb34a

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tensorrt_llm/llmapi/llm_args.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2458,9 +2458,6 @@ def validate_batch_wait_timeout_ms(self) -> 'TorchLlmArgs':
24582458
raise ValueError("batch_wait_timeout_ms must be greater than 0")
24592459
return self
24602460

2461-
def set_mm_encoder_only(self, mm_encoder_only):
2462-
self.mm_encoder_only = mm_encoder_only
2463-
24642461
def get_executor_config(
24652462
self,
24662463
_hf_model_dir: Optional[Path] = None,

tensorrt_llm/llmapi/mm_encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _build_model(self):
5656
self._tokenizer = self.input_processor.tokenizer
5757

5858
assert isinstance(self.args, TorchLlmArgs)
59-
self.args.set_mm_encoder_only(True)
59+
self.args.mm_encoder_only = True
6060

6161
self._executor = self._executor_cls.create(
6262
self._engine_dir,

tests/unittest/llmapi/test_llm_args.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,13 @@ def test_runtime_sizes(self):
438438
assert llm.args.max_seq_len == 128
439439
assert llm.args.max_batch_size == 8
440440

441+
executor_config = llm.args.get_executor_config(
442+
llm._hf_model_dir, llm.tokenizer)
443+
assert executor_config.max_beam_width == 1
444+
assert executor_config.max_num_tokens == 256
445+
assert executor_config.max_seq_len == 128
446+
assert executor_config.max_batch_size == 8
447+
441448
def test_dynamic_setattr(self):
442449
with pytest.raises(pydantic_core._pydantic_core.ValidationError):
443450
args = TorchLlmArgs(model=llama_model_path, invalid_arg=1)

0 commit comments

Comments
 (0)