whisper-small-lv / fix-model-metadata.py
Raivis Dejus
Model fix
d487776
raw
history blame
285 Bytes
import safetensors
from safetensors.torch import save_file
tensors = dict()
with safetensors.safe_open("./model.safetensors", framework="pt") as f:
for key in f.keys():
tensors[key] = f.get_tensor(key)
save_file(tensors, "./model.safetensors", metadata={'format': 'pt'})