Spaces:
Build error
Build error
Update app.py
Browse files714 unmodified lines715716717718719720721722723724725726727728729730718719720721722723724725726727728729730731732733714 unmodified lines return topology
def 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 instance text = f"Base: {agent.base}, Role: {agent.role}, Plugins: {', '.join(agent.plugins)}" agent_features.append(self.node_encoder(text)) 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 instance text = 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_featuresapp.py+13-13