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