MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT-LLM / from_dir

Method from_dir

tensorrt_llm/builder.py:723–736  ·  view source on GitHub ↗
(cls, engine_dir: str, rank: int = 0)

Source from the content-addressed store, hash-verified

721
722 @classmethod
723 def from_dir(cls, engine_dir: str, rank: int = 0):
724 with open(os.path.join(engine_dir, f'rank{rank}.engine'), 'rb') as f:
725 engine_buffer = f.read()
726
727 mw_path = os.path.join(engine_dir,
728 f'rank{rank}_managed_weights.safetensors')
729 managed_weights = deserialize_managed_weights(
730 mw_path) if os.path.exists(mw_path) else None
731
732 config = EngineConfig.from_json_file(
733 os.path.join(engine_dir, 'config.json'))
734 config.pretrained_config.set_rank(rank)
735
736 return cls(config, engine_buffer, managed_weights)
737
738 @classmethod
739 def from_buffer(cls,

Callers 13

check_accuracyFunction · 0.45
initializeMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
run_dtm_ngramFunction · 0.45
__init__Method · 0.45

Calls 3

from_json_fileMethod · 0.45
set_rankMethod · 0.45