From 7b14a613d71023b4221177b44ce97ad8d5c11c91 Mon Sep 17 00:00:00 2001
From: floatingsnake <1227073631@qq.com>
Date: Mon, 27 Mar 2023 21:13:22 +0900
Subject: [PATCH] fix freeze language parameter

---
 magma/magma.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/magma/magma.py b/magma/magma.py
index a2df2a2..df39a55 100644
--- a/magma/magma.py
+++ b/magma/magma.py
@@ -99,6 +99,7 @@ def __init__(self, config, device=None, init_weights=True):
         # freeze parameters
         if config.freeze_lm:
             for name, param in self.lm.named_parameters():  # freeze lm weights
+                param.requires_grad = False
                 if config.adapter_config and "adapter" in name:
                     param.requires_grad = True