Upload model_tiny.py with huggingface_hub
Browse files- model_tiny.py +1 -0
model_tiny.py
CHANGED
|
@@ -349,6 +349,7 @@ def apply_qlora(model, target_modules=None, r=8, alpha=16, dropout=0.0, freeze_e
|
|
| 349 |
parent = getattr(parent, p)
|
| 350 |
qlora = QLoRALinear(module.in_features, module.out_features, r=r, alpha=alpha, dropout=dropout)
|
| 351 |
qlora.quantize_from(module.weight, module.bias)
|
|
|
|
| 352 |
setattr(parent, parts[-1], qlora)
|
| 353 |
qlora_params += 2 * r * module.in_features + module.out_features * r
|
| 354 |
for name, param in model.named_parameters():
|
|
|
|
| 349 |
parent = getattr(parent, p)
|
| 350 |
qlora = QLoRALinear(module.in_features, module.out_features, r=r, alpha=alpha, dropout=dropout)
|
| 351 |
qlora.quantize_from(module.weight, module.bias)
|
| 352 |
+
qlora = qlora.to(module.weight.device)
|
| 353 |
setattr(parent, parts[-1], qlora)
|
| 354 |
qlora_params += 2 * r * module.in_features + module.out_features * r
|
| 355 |
for name, param in model.named_parameters():
|