(file_path, torch_dtype=None, device="cpu")
| 63 | |
| 64 | |
| 65 | def load_state_dict(file_path, torch_dtype=None, device="cpu"): |
| 66 | if file_path.endswith(".safetensors"): |
| 67 | return load_state_dict_from_safetensors(file_path, torch_dtype=torch_dtype, device=device) |
| 68 | else: |
| 69 | return load_state_dict_from_bin(file_path, torch_dtype=torch_dtype, device=device) |
| 70 | |
| 71 | |
| 72 | def load_state_dict_from_safetensors(file_path, torch_dtype=None, device="cpu"): |
no test coverage detected