chatglm-fitness-RLHF / src /utils /safetensor_helper.py
fb700's picture
Upload 171 files
8c9c9c7
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