(self, data_torch: Tensor, name: str, bid: int | None)
| 850 | |
| 851 | |
| 852 | def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]: |
| 853 | # quant weight to i2 (in fp16) |
| 854 | if name.endswith(("q_proj.weight", "k_proj.weight", "v_proj.weight", |
| 855 | "down_proj.weight", "up_proj.weight", "gate_proj.weight", |
| 856 | "o_proj.weight")): |
| 857 | data_torch = self.weight_quant(data_torch) |
| 858 | |
| 859 | return [(self.map_tensor_name(name), data_torch)] |
| 860 | |
| 861 | def write_tensors(self): |
| 862 | max_name_len = max(len(s) for _, s in self.tensor_map.mapping.values()) + len(".weight,") |
no test coverage detected