Lukas Helff
commited on
Commit
·
ac97ee4
1
Parent(s):
79ab7b5
update error message
Browse files
VerifiableRewardsForScalableLogicalReasoning.py
CHANGED
@@ -115,7 +115,7 @@ def _evaluate_with_prolog(prediction, validation_program, eval_config, timeout=5
|
|
115 |
"is_correct": False,
|
116 |
"partial_score": 0.0,
|
117 |
"syntax_valid": False,
|
118 |
-
"error": f"Invalid Syntax: Rule
|
119 |
}
|
120 |
|
121 |
pos_examples = re.findall(rf'{positive_pred}\(([^)]+)\)', validation_program)
|
@@ -175,7 +175,7 @@ check_all :- forall((pos({vars});neg({vars})), check({vars})).
|
|
175 |
|
176 |
is_correct = True if partial_score == 1.0 else False
|
177 |
|
178 |
-
error = f'Rule invalid "{rule_to_evaluate}" with' + result.stderr if result.stderr else None
|
179 |
t1 = time.time()
|
180 |
|
181 |
return {
|
|
|
115 |
"is_correct": False,
|
116 |
"partial_score": 0.0,
|
117 |
"syntax_valid": False,
|
118 |
+
"error": f"Invalid Syntax: Logic Rule not found for symbol '{positive_pred}'"
|
119 |
}
|
120 |
|
121 |
pos_examples = re.findall(rf'{positive_pred}\(([^)]+)\)', validation_program)
|
|
|
175 |
|
176 |
is_correct = True if partial_score == 1.0 else False
|
177 |
|
178 |
+
error = f'Rule invalid: "{rule_to_evaluate}" exit with ' + result.stderr if result.stderr else None
|
179 |
t1 = time.time()
|
180 |
|
181 |
return {
|
app.py
CHANGED
@@ -39,7 +39,7 @@ def create_interface(module):
|
|
39 |
if results["detailed_results"] and len(results["detailed_results"]) > 0:
|
40 |
error = results["detailed_results"][0].get("error")
|
41 |
if error:
|
42 |
-
error_msg =
|
43 |
|
44 |
return (
|
45 |
f"Accuracy score: {results['accuracy']:.4f}",
|
|
|
39 |
if results["detailed_results"] and len(results["detailed_results"]) > 0:
|
40 |
error = results["detailed_results"][0].get("error")
|
41 |
if error:
|
42 |
+
error_msg = error
|
43 |
|
44 |
return (
|
45 |
f"Accuracy score: {results['accuracy']:.4f}",
|