Merge pull request #73 from dnouri/fix-monkeypatch-v1

Bugfix in custom_monkey_patch for v1 models
This commit is contained in:
John Smith 2023-04-10 21:37:27 +08:00 committed by GitHub
commit 68e1b35660
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -24,7 +24,7 @@ def load_model_llama(*args, **kwargs):
print('Apply auto switch and half')
for n, m in model.named_modules():
if isinstance(m, Autograd4bitQuantLinear) or isinstance(m, Linear4bitLt):
if m.groupsize == -1:
if m.is_v1_model:
m.zeros = m.zeros.half()
m.scales = m.scales.half()
m.bias = m.bias.half()