From 9fc035d466d9692a8ddf167712788624ee5f7ac6 Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Fri, 11 Oct 2024 17:06:31 -0700 Subject: [PATCH] fix: Filter invalid messages --- experiments/minif2f/model/llm_agent.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/experiments/minif2f/model/llm_agent.py b/experiments/minif2f/model/llm_agent.py index 9c069a8..048242c 100644 --- a/experiments/minif2f/model/llm_agent.py +++ b/experiments/minif2f/model/llm_agent.py @@ -1,5 +1,6 @@ from typing import Optional import collections, unittest +from termcolor import colored from pantograph.search import Agent from pantograph.server import Server, TacticFailure, ServerError from pantograph.expr import Expr, Tactic, GoalState @@ -70,6 +71,9 @@ class LLMAgent(Agent): print("\n-- new state --\n", new_state) if tactic: + if not isinstance(tactic, Tactic): + print(colored("[Tactic] Failed:", "red"), tactic) + return None return tactic return None else: