(in_path: str)
| 109 | |
| 110 | |
| 111 | def load_safetensors_from_path(in_path: str): |
| 112 | tensors = {} |
| 113 | with safetensors.safe_open(in_path, framework='pt', device='cpu') as f: |
| 114 | for key in f.keys(): |
| 115 | tensors[key] = f.get_tensor(key) |
| 116 | return tensors |
| 117 | |
| 118 | |
| 119 | def load_safetensors_from_dir(in_dir: str): |
no outgoing calls
no test coverage detected