ChatGLM2-SadTalker-VC / src /utils /safetensor_helper.py
kevinwang676's picture
Duplicate from kevinwang676/ChatGLM2-SadTalker
9074b85
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