Skip to content

support localhost agent#1842

Open
Harold-lkk wants to merge 1 commit into
InternLM:agentic_branchfrom
Harold-lkk:lkk/localhost_agent
Open

support localhost agent#1842
Harold-lkk wants to merge 1 commit into
InternLM:agentic_branchfrom
Harold-lkk:lkk/localhost_agent

Conversation

@Harold-lkk
Copy link
Copy Markdown
Member

No description provided.

@Harold-lkk Harold-lkk marked this pull request as ready for review May 26, 2026 13:59
@Harold-lkk Harold-lkk force-pushed the lkk/localhost_agent branch from 249f0fa to 677da3c Compare May 27, 2026 03:25
self.max_concurrent_samples = max_concurrent_samples
self._sample_semaphore = asyncio.Semaphore(max_concurrent_samples) if max_concurrent_samples else None

async def generate_group(self, rollout_state: list[RolloutState], **kwargs) -> list[RolloutState]:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个代码可以考虑放到基类里面去,因为是通用的。否则其他agent 也要写一遍

raw_item = rollout_state.extra_fields["rollout_item"]
if isinstance(raw_item, AgentRolloutItem):
return raw_item.model_copy(deep=True)
return AgentRolloutItem.model_validate(raw_item).model_copy(deep=True)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有可能不是 AgentRolloutItem 吗?如果一定是,不用写这个代码

self,
*,
name: str,
judger_config: Any | None = None,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥既需要judger_config又需要judger?

reward_model = dict(item.reward_model or {})

messages_artifact = item.artifacts.get("messages")
if messages_artifact is not None:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个地方允许是 none?

reward_model=reward_model,
status=Status.COMPLETED if item.infer.status == StageStatus.COMPLETED else Status.FAILED,
)
judged = await self.build().judge(rollout_state)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 judge 可能耗时,那么要额外加判断,不是完成状态不进 judge,可以节省时间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants