update critic_agent use

This commit is contained in:
stellahsr 2023-10-06 16:37:52 +08:00
parent dc0fd134fb
commit d998a48cd2
3 changed files with 4 additions and 4 deletions

View file

@ -46,7 +46,7 @@ class ActionDeveloper(Base):
self._watch([RetrieveSkills])
self.rollout_num_iter = 0
self.task_max_retries = 4
self.critic_reviewer = CriticReviewer()
self.critic_reviewer = agent_registry["critic_agent"]
def render_system_message(self, skills=[], *args, **kwargs):
"""
@ -190,7 +190,7 @@ class ActionDeveloper(Base):
async def run_step(self, human_msg, system_msg, *args, **kwargs):
while True:
messages, reward, done, info = self.runcode_and_evaluate(human_msg, system_msg, *args, **kwargs)
messages, reward, done, info = await self.runcode_and_evaluate(human_msg, system_msg, *args, **kwargs)
if done:
break
return messages, reward, done, info

View file

@ -33,7 +33,7 @@ class CriticReviewer(Base):
# Set events or actions the CriticReviewer should watch or be aware of
# 需要获取最新的events来进行评估
self._watch([GenerateActionCode, AddNewSkills])
self._watch([])
async def run(self, message=None):
"""Observe, only get the observation"""

View file

@ -19,7 +19,7 @@ async def learn(task="Start", investment: float = 50.0, n_round: int = 3):
[
CurriculumDesigner(),
ActionDeveloper(),
# CriticReviewer(),
CriticReviewer(),
SkillManager(),
]