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

Method get_target_modules

tensorrt_llm/lora_manager.py:289–300  ·  view source on GitHub ↗
(self, trtllm_modules_to_hf_modules)

Source from the content-addressed store, hash-verified

287 self.embed_tokens = lora_weight["base_model.model.model.embed_tokens.weight"]
288
289 def get_target_modules(self, trtllm_modules_to_hf_modules):
290 hf_modules_to_trtllm_modules = invert_module_mapping(trtllm_modules_to_hf_modules)
291 lora_target_modules = set()
292 if self.is_valid:
293 hf_target_modules = get_hf_target_modules(
294 self.lora_weight,
295 hf_modules=set(hf_modules_to_trtllm_modules.keys()),
296 )
297 for m in hf_target_modules:
298 trtllm_module = hf_modules_to_trtllm_modules[m]
299 lora_target_modules.add(trtllm_module)
300 return list(lora_target_modules)
301
302
303@lru_cache(maxsize=128)

Callers 2

load_torch_hf_loraFunction · 0.95
load_hf_loraFunction · 0.95

Calls 4

invert_module_mappingFunction · 0.85
get_hf_target_modulesFunction · 0.85
keysMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected