fix: add format to safetensor model
#5
by
drbh
HF Staff
- opened
No description provided.
This pr updates the model file to contain a metadata format value
import safetensors
from safetensors.torch import save_file
tensors = dict()
with safetensors.safe_open(safetensors_path, framework="pt") as f:
for key in f.keys():
tensors[key] = f.get_tensor(key)
save_file(tensors, safetensors_path, metadata={'format': 'pt'})
drbh
changed pull request status to
open
abhinadduri
changed pull request status to
merged