Download src/utils/safetensor_helper.py from regtable/SadTalker: direct link, hf CLI and curl.
- Browser
- Download file 198 Bytes
-
https://huggingface.co/spaces/regtable/SadTalker/resolve/main/src/utils/safetensor_helper.py
- Command line
-
hf download hf://spaces/regtable/SadTalker/src/utils/safetensor_helper.py
-
curl -L -o safetensor_helper.py https://huggingface.co/spaces/regtable/SadTalker/resolve/main/src/utils/safetensor_helper.py
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 |