Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Spaces:
united-avatars
/
linly
like
0
Running
App
Files
Files
Community
bc3753a
linly
/
src
/
utils
/
safetensor_helper.py
David Victor
init
bc3753a
2 months 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