(src, dst)
| 36 | try: |
| 37 | from bitsandbytes.nn import LinearNF4 |
| 38 | def copy_nested_list(src, dst): |
| 39 | for i in range(len(dst)): |
| 40 | if type(dst[i]) is torch.Tensor: |
| 41 | dst[i].copy_(src[i]) |
| 42 | elif type(dst[i]) is list: |
| 43 | copy_nested_list(src[i], dst[i]) |
| 44 | else: |
| 45 | dst[i] = src[i] |
| 46 | class HackLinearNF4(LinearNF4): |
| 47 | def _load_from_state_dict(self, state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs): |
| 48 | if prefix + 'weight' in state_dict: |
no outgoing calls
no test coverage detected