"""Independent V7 clone with two TCP nodes and four-view VLM input.""" from torch import nn from .adapter import CONTRACT from .graph import EdgeMemoryGraph class PreparedPerception(nn.Module): def forward(self, examples, track=False): for e in examples: if e.get('graph_contract') != CONTRACT: raise ValueError('Wrong graph contract') return [e['pilot_objects'] for e in examples] def install_graph(model): from .framework import Qwen_GR00T from .visual_patch import MODE from .contracts import pooling_contract if not isinstance(model,Qwen_GR00T): raise TypeError('Use the copied Stack V1 framework') c=model.config.framework.graph c.prompt_local_k=2;c.geometry_input_dim=4;c.geometry_loss_dim=4 c.edge_status_input=False;c.bptt=1;c.visual_pooling=MODE c.visual_pooling_contract=pooling_contract() model.graph_enabled=True model.graph_model=EdgeMemoryGraph(model.qwen_vl_interface.model.config.hidden_size,c) model.graph_perception=PreparedPerception() return model