(model)
| 134 | module.use_temporary_parameter=True |
| 135 | |
| 136 | def clear_temp_variable(model): |
| 137 | for name, module in model.named_modules(): |
| 138 | if isinstance(module, QuantLinear): |
| 139 | if hasattr(module, "temp_weight"): |
| 140 | del module.temp_weight |
| 141 | if hasattr(module, "temp_bias"): |
| 142 | del module.temp_bias |
| 143 | |
| 144 | @torch.no_grad() |
| 145 | def smooth_and_quant_inplace(model, args, isllama): |