Spaces:
Build error
Build error
Update app.py
Browse files713 unmodified lines714715716717718719720721722723724725726727728729730731732733734735736713 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_featuresdef compute_loss(self,mu: torch.Tensor,713 unmodified lines714715716717718719720721722723724725726727728729730731732733734735736713 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_featuresdef compute_loss(self,mu: torch.Tensor,
app.py+14-14