feat: steps counter in llm-success
This commit is contained in:
parent
68330c5163
commit
64fbce018a
@ -100,6 +100,7 @@ class NavGPTOutputParser(AgentOutputParser):
|
||||
print(f"SUCCESS = {SUCCESS}")
|
||||
|
||||
NOW_LOCATION = tool_input
|
||||
TEMP_STEPS_COUNTER += 1
|
||||
print(f"NOW_LOCATION = {NOW_LOCATION}")
|
||||
|
||||
|
||||
@ -120,6 +121,8 @@ class NavGPTOutputParser(AgentOutputParser):
|
||||
return AgentAction(action, tool_input, text)
|
||||
elif includes_answer:
|
||||
if NOW_LOCATION == FINAL_STOP_POINT:
|
||||
STEPS_COUNTER += TEMP_STEPS_COUNTER
|
||||
TEMP_STEPS_COUNTER = 0
|
||||
SUCCESS += 1
|
||||
print(f"SUCCESS = {SUCCESS}")
|
||||
else:
|
||||
@ -128,6 +131,7 @@ class NavGPTOutputParser(AgentOutputParser):
|
||||
print(f"{NOW_LOCATION}_{type(NOW_LOCATION)}")
|
||||
print(f"{FINAL_STOP_POINT}_{type(FINAL_STOP_POINT)}")
|
||||
print(f"SUCCESS = {SUCCESS}")
|
||||
print(f"STEPS_COUNTER = {STEPS_COUNTER}")
|
||||
return AgentFinish(
|
||||
{"output": text.split(FINAL_ANSWER_ACTION)[-1].strip()}, text
|
||||
)
|
||||
@ -712,6 +716,7 @@ class NavGPTAgent(BaseAgent):
|
||||
|
||||
global FINAL_STOP_POINT
|
||||
global TEMP_STEPS_COUNTER
|
||||
global STEPS_COUNTER
|
||||
global NOW_LOCATION
|
||||
|
||||
FINAL_STOP_POINT = obs[0]['stop']
|
||||
|
||||
Loading…
Reference in New Issue
Block a user