File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -156,11 +156,14 @@ def iterate_hf_lora(
156156 hf_module = module_name
157157
158158 # If module_name contains dots (e.g., "shared_expert.down_proj"),
159- # extract just the final component (e.g., "down_proj")
159+ # extract just the final component (e.g., "down_proj").
160+ # Skip this fallback for shared_expert modules to avoid
161+ # silently mapping them to the wrong mlp_* module type.
160162 if hf_module not in hf_modules and "." in hf_module :
161- final_component = hf_module .split ("." )[- 1 ]
162- if final_component in hf_modules :
163- hf_module = final_component
163+ if not hf_module .startswith ("shared_expert." ):
164+ final_component = hf_module .split ("." )[- 1 ]
165+ if final_component in hf_modules :
166+ hf_module = final_component
164167
165168 if hf_module not in hf_modules :
166169 # Skip modules not in the supported mapping (only log once per module type)
You can’t perform that action at this time.
0 commit comments