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]
Enh(reviewer): Take last found number instead
Kilian Liereta697af898879
diff --git a/sweagent/agent/reviewer.py b/sweagent/agent/reviewer.pyindex c0b39656..b7130536 100644--- a/sweagent/agent/reviewer.py+++ b/sweagent/agent/reviewer.py@@ -248,10 +248,10 @@ class Reviewer(AbstractReviewer):self.logger.warning("Could not interpret response: %s, will reject submission.", response)return Falseelif self._config.output_type == "float":- # use regex- number = re.search(r"\d+\.?\d*", last_line)- if number:- return float(number.group(0))+ # Find all numbers in the last line and take the last one+ numbers = re.findall(r"\d+\.?\d*", last_line)+ if numbers:+ return float(numbers[-1])else:self.logger.warning("Could not interpret response: %s, will reject submission.",