two minor fixes (#335)

This commit is contained in:
Awni Hannun
2024-01-18 14:18:13 -08:00
committed by GitHub
parent d8680a89f9
commit bcc9fc3581
3 changed files with 12 additions and 3 deletions

View File

@@ -200,3 +200,10 @@ class Model(nn.Module):
):
out, cache = self.model(inputs, cache)
return self.lm_head(out), cache
@staticmethod
def sanitize(weights):
# Remove unused precomputed rotary freqs
return {
k: v for k, v in weights.items() if "self_attn.rotary_emb.inv_freq" not in k
}