(model)
| 23 | |
| 24 | |
| 25 | def injection_assert(model): |
| 26 | # pick out random linear that should have been replaced and initialized |
| 27 | q_proj = model.model.layers[1].self_attn.q_proj |
| 28 | |
| 29 | assert isinstance(q_proj, LoRAOptimizedLinear), "injection did not happen" |
| 30 | assert q_proj._initialized, "lora was not initialized properly" |
| 31 | assert isinstance(q_proj.lora_weight_1, torch.nn.Linear) |
| 32 | assert isinstance(q_proj.lora_weight_2, torch.nn.Linear) |
| 33 | |
| 34 | |
| 35 | class TestEngine(DistributedTest): |
no outgoing calls
no test coverage detected