diff --git a/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/.train_lora.py.swp b/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/.train_lora.py.swp index 0b4a6064c..bc626fd43 100644 Binary files a/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/.train_lora.py.swp and b/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/.train_lora.py.swp differ diff --git a/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/train_lora.py b/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/train_lora.py index 125d79fbf..aa9197980 100755 --- a/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/train_lora.py +++ b/egs/librispeech/ASR/pruned_transducer_stateless_d2v_v2/train_lora.py @@ -1607,27 +1607,30 @@ def run_adapter(rank, world_size, args, wb=None): lora_modules = [] for modules in model.modules(): if isinstance(modules, fairseq.modules.multihead_attention.MultiheadAttention): - #lora_modules.append(LoRAHook(modules)) - for module in modules.modules(): + lora_modules.append(LoRAHook(modules)) + #for module in modules.modules(): # if rank == 0: logging.info(module) #print(module) - if isinstance(module, torch.nn.Linear): + #if isinstance(module, torch.nn.Linear): #if rank == 0: print(module) - lora_modules.append(LoRAHook(module)) + #lora_modules.append(LoRAHook(module)) adapter_names = [] adapter_param = [] + ''' for i, lora in enumerate(lora_modules): for n, p in lora.lora.named_parameters(): new_n = str(i) + n adapter_names.append(new_n) adapter_param.append(p) - - #for n, p in model.named_parameters(): - #if 'joiner' in n or 'simple' in n or 'ctc' in n: - # p.requires_grad = True - #else: - # p.requires_grad = False + ''' + for n, p in model.named_parameters(): + if 'joiner' in n or 'simple' in n or 'ctc' in n: + adapter_names.append(n) + adapter_param.append(p) + p.requires_grad = True + else: + p.requires_grad = False #for lora in lora_modules: # print(lora.lora.state_dict())