CogACT-Base is a 7B vision-language-action (VLA) model that maps a single-view
RGB image + a natural-language instruction to the next 16 (7-DoF) robot
end-effector delta actions (x, y, z, roll, pitch, yaw, gripper). It is built on a
DINOv2 + SigLIP dual vision encoder, a Llama-2-7B text backbone and a DiT-B
diffusion action head, pretrained on Open X-Embodiment.
This repository adapts CogACT/CogACT-Base to run on Ascend NPU via
torch_npu (Ascend 910B, npu:0, bfloat16). The vendored model source lives in
model_code/ (MIT, from microsoft/CogACT),
scrubbed of all CUDA device calls.
.cuda() / torch.cuda / device="cuda" calls were removed;
the model and every input tensor live on npu:0.try-except → on failure a JSON error is printed and the
process exits.torch.compile is intentionally skipped.pretrained=False and the LLM scaffold
with inference_mode=True — the real weights are loaded from the local
CogACT-Base.pt checkpoint, so no HuggingFace / timm weight download happens
at inference time.model_weights/CogACT/CogACT-Base/
checkpoints/CogACT-Base.pt — full PyTorch checkpoint (~30 GB, bf16 model +
optimizer state; only the model key is used)config.json, config.yaml, dataset_statistics.jsonllama2-tokenizer/ — local Llama-2 tokenizer (config.json, tokenizer.json …)inference.py automatically uses this local cache. If the checkpoint is missing
it refuses to start rather than re-downloading.https://ai.gitcode.com/hf_mirrors/CogACT/CogACT-Base
(fallback: https://hf-mirror.com/CogACT/CogACT-Base).Install dependencies (torch + torch_npu for Ascend, see requirements.txt):
pip install -r requirements.txtASCEND_RT_VISIBLE_DEVICES=1 python3 inference.py --img examples/demo.jpg \
--instr "pick up the object" 2>cli.err | tee cli.logPrints one JSON object to stdout (CANN noise goes to stderr).
python3 inference.py --mode server --port 8786GET / — minimal dark-terminal HTML upload page.POST /predict — multipart file (robot-view image) + optional instr form
field → same JSON result.curl -s -F file=@examples/demo.jpg -F instr="pick up the object" \
http://127.0.0.1:8786/predict | python3 -m json.toolexamples/demo.jpg — a 768×768 JPEG crop of the robot image
scripts/aml/test_image.png from the official microsoft/CogACT repository
(1024×1024 PNG), demonstrating the input format CogACT expects.{
"model": "CogACT/CogACT-Base",
"source": "https://ai.gitcode.com/hf_mirrors/CogACT/CogACT-Base",
"device": "npu:0",
"status": "success",
"instruction": "pick up the object",
"unnorm_key": "fractal20220817_data",
"cfg_scale": 1.5,
"ddim_steps": 10,
"elapsed_ms": 1234.56,
"action_dim": 7,
"num_steps": 16,
"actions": [[x,y,z,roll,pitch,yaw,gripper], ...],
"normalized_actions": [[...], ...],
"first_action": [x,y,z,roll,pitch,yaw,gripper]
}actions — 16 rows × 7 cols of denormalized end-effector deltas
(unnormalized with the fractal20220817_data dataset statistics; the gripper
channel is binarised to 0/1).normalized_actions — the same actions in [-1, 1] before un-normalisation.assets/agent_workflow.png — NPU environment check + dependency install + launch.assets/npu_device_call.png — real CLI run (2>cli.err | tee cli.log).assets/model_result.png — FastAPI GET / page + real /predict JSON.model_code/ from
microsoft/CogACT (MIT).