Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
fb700
/
chatglm-fitness-RLHF
like
29
Runtime error
App
Files
Files
Community
5
2c00c66
chatglm-fitness-RLHF
/
src
/
utils
/
safetensor_helper.py
fb700
Upload 171 files
8c9c9c7
over 1 year ago
raw
Copy download link
history
blame
Safe
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