(self, weight)
| 802 | self.gguf_writer.add_rope_scaling_factor(1.0) |
| 803 | |
| 804 | def weight_quant(self, weight): |
| 805 | dtype = weight.dtype |
| 806 | weight = weight.float() |
| 807 | s = 1 / weight.abs().mean().clamp(min=1e-5) |
| 808 | result = (weight * s).round().clamp(-1, 1) / s |
| 809 | return result.type(dtype) |
| 810 | |
| 811 | def transform_to_tl1(self, x: np.ndarray): |
| 812 | scale = np.max(np.abs(x)) |