# pip install git+https://github.com/openai/whisper.git # pip install safetensors import whisper import safetensors.torch model = whisper.load_model("small") safetensors.torch.save_model(model, "model.safetensors") tensors = dict() with safetensors.safe_open("./model.safetensors", framework="pt") as f: for key in f.keys(): tensors[key] = f.get_tensor(key) safetensors.torch.save_file(tensors, "./model.safetensors", metadata={'format': 'pt'})