File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1363,7 +1363,6 @@ def setup_low_rank_optimizer(
13631363 and args .optim_target_modules .replace ("_" , "-" ) == "all-linear"
13641364 )
13651365
1366- target_params = []
13671366 target_params_names = []
13681367 for module_name , module in model .named_modules ():
13691368 target_module_exists , is_regex = check_target_module_exists (
@@ -1380,12 +1379,12 @@ def setup_low_rank_optimizer(
13801379 if not target_module_exists and not all_linear :
13811380 continue
13821381
1383- target_params .append (module .weight )
13841382 target_params_names .append (module_name + ".weight" )
13851383
1386- if len (target_params ) == 0 :
1384+ if len (target_params_names ) == 0 :
13871385 raise ValueError (f"No target modules found for { optimizer_name } ({ args .optim_target_modules } )." )
13881386
1387+ target_params = [p for n , p in model .named_parameters () if n in target_params_names ]
13891388 non_target_params = [p for n , p in model .named_parameters () if n not in target_params_names ]
13901389 optim_kwargs .update (optim_args )
13911390
You can’t perform that action at this time.
0 commit comments