Hugging Face
Models
Datasets
Spaces
Posts
Docs
Solutions
Pricing
Log In
Sign Up
Spaces:
thepianist9
/
lop
like
0
Runtime error
App
Files
Files
Community
5a256aa
lop
/
src
/
utils
/
safetensor_helper.py
thepianist9
Upload folder using huggingface_hub
5a256aa
verified
3 months ago
raw
Copy download link
history
blame
Safe
205 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