Skip to content

SWE-agent takes a GitHub issue and tries to automatically fix it, using your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges. [NeurIPS 2024]

Update model id name to account for None values in top-p / temp

carlosejimenezf2d165775ee7
diff --git a/sweagent/agent/models.py b/sweagent/agent/models.py
index eb00c550..d240a119 100644
--- a/sweagent/agent/models.py
+++ b/sweagent/agent/models.py
@@ -185,7 +185,15 @@ class GenericAPIModelConfig(PydanticBaseModel):
@property
def id(self) -> str:
- return f"{self.name}__t-{self.temperature:.2f}__p-{self.top_p:.2f}__c-{self.per_instance_cost_limit:.2f}"
+ if self.top_p is None:
+ top_p = "None"
+ else:
+ top_p = f"{self.top_p:.2f}"
+ if self.temperature is None:
+ temperature = "None"
+ else:
+ temperature = f"{self.temperature:.2f}"
+ return f"{self.name}__t-{temperature}__p-{top_p}__c-{self.per_instance_cost_limit:.2f}"
class ReplayModelConfig(GenericAPIModelConfig):