Spaces:
Build error
Build error
Download src/pixel3dmm/preprocessing/facer/scripts/clean_checkpoint.py from karolwoz/pixel3dmms: direct link, hf CLI and curl.
- Browser
- Download file 379 Bytes
-
https://huggingface.co/spaces/karolwoz/pixel3dmms/resolve/main/src/pixel3dmm/preprocessing/facer/scripts/clean_checkpoint.py
- Command line
-
hf download hf://spaces/karolwoz/pixel3dmms/src/pixel3dmm/preprocessing/facer/scripts/clean_checkpoint.py
-
curl -L -o clean_checkpoint.py https://huggingface.co/spaces/karolwoz/pixel3dmms/resolve/main/src/pixel3dmm/preprocessing/facer/scripts/clean_checkpoint.py
379 Bytes
| import argparse | |
| import torch | |
| if __name__=='__main__': | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('input', type=str, default='input') | |
| parser.add_argument('output', type=str, default='output') | |
| args = parser.parse_args() | |
| state = torch.load(args.input, map_location='cpu') | |
| clean_state = state['model'] | |
| torch.save(clean_state, args.output) |