audio_img / test.py
pengdaqian
add more
f0c5f90
raw
history blame
406 Bytes
from safetensors import safe_open
from safetensors.torch import save_file
tensors = {}
with safe_open('audio_text_embeddings.safetensors', framework="pt", device=0) as f:
for k in f.keys():
tensors[k] = f.get_tensor(k)
text_embed = tensors["text_embed"].detach().cpu()
tensors = {
"text_embed": text_embed,
}
save_file(tensors, "/root/autodl-tmp/audio_text_embeddings_ cpu.safetensors")