API_MC_AI / SadTalker /src /utils /safetensor_helper.py
duyv's picture
Upload 139 files
9c79341 verified
raw
history blame contribute delete
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