File size: 272 Bytes
fd297e1
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from safetensors import safe_open
resolved_archive_file = "model.safetensors"

try:
    with safe_open(resolved_archive_file, framework="pt") as f:
        metadata = f.metadata()
    print(metadata)
except Exception as e:
    print(f"Failed to open safetensor file: {e}")