ChatLei / chat_anything /sad_talker /utils /safetensor_helper.py
akatukime's picture
Upload folder using huggingface_hub
d3fb87a
raw
history blame
198 Bytes
def load_x_from_safetensor(checkpoint, key):
x_generator = {}
for k,v in checkpoint.items():
if key in k:
x_generator[k.replace(key+'.', '')] = v
return x_generator