Views
No views yet
1# Create conda environment
2conda create --name wallx python=3.10
3conda activate wallx
4
5# Install base requirements
6pip install torch torchvision transformers
7pip install huggingface_hub
8
9# Install Wall-X from GitHub
10git clone https://github.com/X-Square-Robot/wall-x.git
11cd wall-x
12pip install -e .1import torch
2from wall_x.model.qwen2_5_based.modeling_qwen2_5_vl_act import Qwen2_5_VLMoEForAction
3
4# Load the model
5model_path = "X-Square-Robot/wall-oss-fast" # or your local path
6model = Qwen2_5_VLMoEForAction.from_pretrained(model_path)
7model.eval()
8
9# Configuration
10device = "cuda" if torch.cuda.is_available() else "cpu"
11model = model.to(device).bfloat16()
12
13# Your inference code here...1# Run training (see workspace/README.md for detailed configuration)
2bash ./workspace/lerobot_example/run.sh1import torch
2from wall_x.model.qwen2_5_based.modeling_qwen2_5_vl_act import Qwen2_5_VLMoEForAction
3
4# Load model
5model_path = "X-Square-Robot/wall-x"
6model = Qwen2_5_VLMoEForAction.from_pretrained(model_path)
7model.eval()
8
9# Setup
10batch_size = 1
11seq_length = 50
12device = "cuda" if torch.cuda.is_available() else "cpu"
13model = model.to(device).bfloat16()
14
15# Prepare inputs (example with synthetic data)
16torch.manual_seed(0)
17input_ids = torch.randint(0, len(model.processor.tokenizer), (batch_size, seq_length), dtype=torch.long)
18attention_mask = torch.ones((batch_size, seq_length), dtype=torch.long)
19moe_token_types = torch.zeros((batch_size, seq_length), dtype=torch.long)
20position_ids = torch.arange(seq_length, dtype=torch.long).unsqueeze(0).expand(batch_size, -1)
21
22# Robotics-specific inputs
23proprioception = torch.randn((batch_size, 1, 20), dtype=torch.float32) # Joint states
24agent_pos_mask = torch.ones((batch_size, 1, 20), dtype=torch.float32)
25dof_mask = torch.ones((batch_size, 32, 20), dtype=torch.float32) # DOF mask
26dataset_names = ["x2_normal"]
27
28# Move to device
29inputs = {
30 "input_ids": input_ids.to(device),
31 "attention_mask": attention_mask.to(device),
32 "moe_token_types": moe_token_types.to(device),
33 "position_ids": position_ids.to(device),
34 "proprioception": proprioception.to(device).bfloat16(),
35 "agent_pos_mask": agent_pos_mask.to(device).bfloat16(),
36 "dof_mask": dof_mask.to(device).bfloat16(),
37 "dataset_names": dataset_names,
38 "mode": "validate"
39}
40
41# Run inference
42with torch.no_grad():
43 outputs = model(**inputs)
44 print(f"Output logits shape: {outputs.logits.shape}")1# Basic inference test
2python ./scripts/fake_inference.py
3
4# Generate open-loop comparison plots
5python ./scripts/draw_openloop_plot.py1@misc{walloss_paper_2025,
2 title = {WALL-OSS: Igniting VLMs toward the Embodied Space},
3 author = {X Square Robot},
4 year = {2025},
5 howpublished = {\url{https://x2robot.cn-wlcb.ufileos.com/wall_oss.pdf}},
6 note = {White paper}
7}