Spaces:
Build error
Build error
Update app.py
Browse files714 unmodified lines715716717718719720721722723724725726727728729730731732733714 unmodified linesreturn topologydef encode_agents(self,agents: List[Union[Dict, SpecializedAgent]],query: str) -> Tuple[torch.Tensor, torch.Tensor]:"""Encode agents and query into node features."""agent_features = []for agent in agents:if isinstance(agent, dict):text = f"Base: {agent['base']}, Role: {agent['role']}, Plugins: {', '.join(agent['plugins'])}"else: # SpecializedAgent instancetext = f"Base: {agent.base}, Role: {agent.role}, Plugins: {', '.join(agent.plugins)}"agent_features.append(self.node_encoder(text))task_features = self.node_encoder(query)node_features = torch.stack(agent_features)return node_features, task_features714 unmodified lines715716717718719720721722723724725726727728729730731732733714 unmodified linesreturn topologydef encode_agents(self,agents: List[Union[Dict, SpecializedAgent]],query: str) -> Tuple[torch.Tensor, torch.Tensor]:"""Encode agents and query into node features."""agent_features = []for agent in agents:if isinstance(agent, dict):text = f"Base: {agent['base']}, Role: {agent['role']}, Plugins: {', '.join(agent['plugins'])}"else: # SpecializedAgent instancetext = f"Base: {agent.base}, Role: {agent.role}, Plugins: {', '.join(agent.plugins)}"agent_features.append(self.node_encoder(text))task_features = self.node_encoder(query)node_features = torch.stack(agent_features)return node_features, task_features
app.py+13-13