Based on LeRobot's code analysis, the minimum files required for inference are:
The policy configuration file containing:
- Policy type (must be
"pi0"for PI 0.5) - Model architecture settings
- Device configuration (cpu/cuda)
- Input/output feature definitions
- Any policy-specific hyperparameters
Location: Root of repository
Loaded by: PreTrainedConfig.from_pretrained()
The actual trained model weights in SafeTensors format.
Location: Root of repository
Loaded by: hf_hub_download() with filename SAFETENSORS_SINGLE_FILE
Note: This is the main model file and will be the largest file (typically several GB)
Preprocessor configuration that defines how to transform raw observations before feeding to the policy.
Includes:
- Image normalization parameters
- State normalization statistics (mean, std)
- Device settings
- Data type conversions
Location: Root of repository
Loaded by: PolicyProcessorPipeline.from_pretrained() with filename "policy_preprocessor.json"
Postprocessor configuration that defines how to transform policy outputs to robot actions.
Includes:
- Action denormalization parameters
- Output scaling/clipping
- Action space mapping
Location: Root of repository
Loaded by: PolicyProcessorPipeline.from_pretrained() with filename "policy_postprocessor.json"
bdhillon/PIv2/
├── config.json # Policy configuration
├── model.safetensors # Model weights
├── policy_preprocessor.json # Input preprocessing config
└── policy_postprocessor.json # Output postprocessing config
Documentation about the model, training details, usage instructions.
HuggingFace configuration for LFS (Large File Storage) for the safetensors file.
-
Policy Loading (
pretrained.py:70-128):# Loads config.json config = PreTrainedConfig.from_pretrained(pretrained_name_or_path) # Downloads and loads model.safetensors model_file = hf_hub_download( repo_id=model_id, filename="model.safetensors" ) policy = cls._load_as_safetensor(instance, model_file, device)
-
Preprocessor Loading (
factory.py:202-211):preprocessor = PolicyProcessorPipeline.from_pretrained( pretrained_model_name_or_path=pretrained_path, config_filename="policy_preprocessor.json" )
-
Postprocessor Loading (
factory.py:212-221):postprocessor = PolicyProcessorPipeline.from_pretrained( pretrained_model_name_or_path=pretrained_path, config_filename="policy_postprocessor.json" )
To verify your bdhillon/PIv2 repository has the minimum required files, run:
# Install huggingface_hub if not already installed
pip install huggingface_hub
# List files in the repository
python -c "
from huggingface_hub import list_repo_files
files = list_repo_files('bdhillon/PIv2')
print('Files in bdhillon/PIv2:')
for f in sorted(files):
print(f' - {f}')
required = ['config.json', 'model.safetensors', 'policy_preprocessor.json', 'policy_postprocessor.json']
print('\nRequired files check:')
for req in required:
status = '✓' if req in files else '✗ MISSING'
print(f' {status} {req}')
"| Missing File | Error Message | Impact |
|---|---|---|
config.json |
"config.json not found" | Cannot instantiate policy |
model.safetensors |
"model.safetensors not found on HuggingFace Hub" | Cannot load weights |
policy_preprocessor.json |
"policy_preprocessor.json not found" | Cannot preprocess observations |
policy_postprocessor.json |
"policy_postprocessor.json not found" | Cannot postprocess actions |
If you trained your own PI 0.5 model, these files are created by LeRobot's training pipeline:
-
During Training:
config.jsonis created from your training configmodel.safetensorsis saved at checkpoints- Processor configs are created during dataset preprocessing
-
Pushing to Hub:
# LeRobot automatically includes all required files policy.push_model_to_hub(cfg)
-
From Local Checkpoint: If you have a local checkpoint at
outputs/train/pi0_myexp/checkpoints/005000/pretrained_model/:# This directory should contain all 4 required files ls outputs/train/pi0_myexp/checkpoints/005000/pretrained_model/ # Should show: # config.json # model.safetensors # policy_preprocessor.json # policy_postprocessor.json
Minimum inference bundle = 4 files:
config.json- Policy architecturemodel.safetensors- Trained weightspolicy_preprocessor.json- Input processingpolicy_postprocessor.json- Output processing
All 4 must be present in the HuggingFace repository for inference to work.