MCPcopy
hub / github.com/NVIDIA/TensorRT-LLM / read_config

Function read_config

tensorrt_llm/runtime/model_runner.py:67–81  ·  view source on GitHub ↗

Read the engine config file and create a ModelConfig instance, return the ModelConfig instance and other config fields in a dict. Args: config_path (Path): The path of engine config file. Returns: Tuple[ModelConfig, dict]: A ModelConfig instance and oth

(config_path: Path)

Source from the content-addressed store, hash-verified

65
66
67def read_config(config_path: Path) -> Tuple[ModelConfig, dict]:
68 """
69 Read the engine config file and create a ModelConfig instance, return the ModelConfig instance
70 and other config fields in a dict.
71
72 Args:
73 config_path (Path):
74 The path of engine config file.
75
76 Returns:
77 Tuple[ModelConfig, dict]: A ModelConfig instance and other config fields.
78 """
79 with open(config_path, 'r') as f:
80 config = json.load(f)
81 return _builder_to_model_config(config)
82
83
84def _builder_to_model_config(config: dict) -> Tuple[ModelConfig, dict]:

Callers 1

from_dirMethod · 0.70

Calls 2

_builder_to_model_configFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected