Skip to content

Download and verify a projector on CPU

Pin the CIF checkpoint, inspect its configuration, and check a synthetic forward pass.

Use the public JARVIS formation-energy checkpoint for a small test of the download, weight loading, and tensor interface. The commands require Python and run without a language-model download or a GPU.

Download from the pinned snapshot

git clone https://github.com/InternLM/Sage-SciPerception.git
cd Sage-SciPerception
python -m pip install -r requirements.txt
python load_projector.py glm-5.3-flash/cif/jarvis \
  --revision 7c228fc03394027fed19bda1ff26388394b0031a \
  --local-dir ./checkpoints

load_projector.py resolves the ID in the Hugging Face repository index, then downloads the component configuration and weights from the same snapshot. With --local-dir, the command also copies the index into ./checkpoints and prints the local component directory. Browse the pinned snapshot.

Load and exercise the module

Save or run the following Python code from the repository root. load_projector calls modeling_projector.build with the architecture and output width declared in the component configuration. It loads the weights strictly and returns a frozen module in evaluation mode.

Example 2-1 Run a synthetic two-row projection on CPU.
import torch

from load_projector import load_projector

projector, config = load_projector(
    "checkpoints/projectors/glm-5.3-flash/cif/jarvis", device="cpu"
)
with torch.inference_mode():
    features = torch.zeros(2, config["projector"]["feature_dim"])
    payload = projector(features, torch.arange(features.shape[0]))

assert config["task"] == "cif/jarvis"
assert payload.shape == (2, 4096)
assert torch.isfinite(payload).all()
print(config["task"], tuple(payload.shape))

Expect cif/jarvis (2, 4096). The two zero rows exercise only the projector. For formation-energy inference, prepare real CHGNet states with 64 features per atom in atom order, then follow the vLLM chapter.