MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / __init__

Method __init__

lightx2v/utils/lora_loader.py:184–193  ·  view source on GitHub ↗

Args: key_mapping_rules: Optional list of (pattern, replacement) regex rules for key mapping model_prefix: Optional prefix to add to model keys (e.g., "model.diffusion_model." for LTX2)

(self, key_mapping_rules: Optional[List[Tuple[str, str]]] = None, model_prefix: Optional[str] = None)

Source from the content-addressed store, hash-verified

182 """Loads and applies LoRA weights to model weights using pattern matching."""
183
184 def __init__(self, key_mapping_rules: Optional[List[Tuple[str, str]]] = None, model_prefix: Optional[str] = None):
185 """
186 Args:
187 key_mapping_rules: Optional list of (pattern, replacement) regex rules for key mapping
188 model_prefix: Optional prefix to add to model keys (e.g., "model.diffusion_model." for LTX2)
189 """
190 self.pattern_matcher = LoRAPatternMatcher()
191 self.key_mapping_rules = key_mapping_rules or []
192 self.model_prefix = model_prefix
193 self._compile_rules()
194
195 def _compile_rules(self):
196 """Pre-compile regex patterns for better performance."""

Callers

nothing calls this directly

Calls 2

_compile_rulesMethod · 0.95
LoRAPatternMatcherClass · 0.85

Tested by

no test coverage detected