Download examples/load_weights.py from hieuphamha/BrainAxL: direct link, hf CLI and curl.
- Browser
- Download file 466 Bytes
-
https://huggingface.co/hieuphamha/BrainAxL/resolve/main/examples/load_weights.py
- Command line
-
hf download hf://hieuphamha/BrainAxL/examples/load_weights.py
-
curl -L -o load_weights.py https://huggingface.co/hieuphamha/BrainAxL/resolve/main/examples/load_weights.py
466 Bytes
| """Download and inspect BrainAxL weights without custom remote code.""" | |
| from huggingface_hub import hf_hub_download | |
| from safetensors.torch import load_file | |
| path = hf_hub_download( | |
| repo_id="hieuphamha/BrainAxL", | |
| filename="brainaxl-b/model.safetensors", | |
| ) | |
| state_dict = load_file(path, device="cpu") | |
| print(f"Loaded {len(state_dict)} tensors") | |
| # Instantiate brainaxl_b from the linked GitHub repository, then: | |
| # model.load_state_dict(state_dict, strict=True) | |