Skip to navigation

nemo_gym.tasks.harbor.materialize

View as Markdown

Turn loaded tasks into single-agent-turn rows and the run config that serves them.

Module Contents

Functions

NameDescription
_instance_taskset-
_validate_task_ids-
agent_instanceReturn an override-compatible agent instance name for the taskset.
environment_server_instanceReturn an override-compatible environment instance name for the taskset.
materialize_taskOne row: the instruction as a user message, the folder digest in task_data.
resources_server_instanceReturn an override-compatible resources instance name without changing the taskset ID.
run_configThe run-config blocks that bind one taskset to the harbor resources server.
taskset_mappingWhere a taskset’s folders live and which digest each task had at materialization.
write_rowsWrite one materialized row per task as JSONL and return the rows.

Data

AGENT_TIMEOUT_METADATA_KEY

ENVIRONMENT_SERVER_IMPL

RESOURCES_SERVER_IMPL

API

nemo_gym.tasks.harbor.materialize._instance_taskset(
taskset: str
) -> str
nemo_gym.tasks.harbor.materialize._validate_task_ids(
) -> None
nemo_gym.tasks.harbor.materialize.agent_instance(
taskset: str
) -> str

Return an override-compatible agent instance name for the taskset.

nemo_gym.tasks.harbor.materialize.environment_server_instance(
taskset: str
) -> str

Return an override-compatible environment instance name for the taskset.

One row: the instruction as a user message, the folder digest in task_data.

nemo_gym.tasks.harbor.materialize.resources_server_instance(
taskset: str
) -> str

Return an override-compatible resources instance name without changing the taskset ID.

nemo_gym.tasks.harbor.materialize.run_config(
taskset: str,
folder: pathlib.Path,
rows_path: pathlib.Path,
agent_instance_name: str,
agent_impl: str,
agent_overrides: dict[str, typing.Any] | None = None,
sandbox_provider: str = 'sandbox'
) -> dict[str, typing.Any]

The run-config blocks that bind one taskset to the harbor resources server.

The agent block inherits the selected harness config and points it at the taskset’s resources server. The environment server is a single_agent_turn instance. Rows route to it by taskset.

nemo_gym.tasks.harbor.materialize.taskset_mapping(
folder: pathlib.Path
) -> dict[str, typing.Any]

Where a taskset’s folders live and which digest each task had at materialization.

Servers resolve a task as <folder>/<task_id>. For a folder of task folders that is the folder itself; for a single task folder it is the task’s parent, so folder is always the tasks’ common parent directory.

nemo_gym.tasks.harbor.materialize.write_rows(
taskset: str,
path: pathlib.Path
) -> list[dict[str, typing.Any]]

Write one materialized row per task as JSONL and return the rows.

nemo_gym.tasks.harbor.materialize.AGENT_TIMEOUT_METADATA_KEY = 'agent_timeout_sec'
nemo_gym.tasks.harbor.materialize.ENVIRONMENT_SERVER_IMPL = 'single_agent_turn'
nemo_gym.tasks.harbor.materialize.RESOURCES_SERVER_IMPL = 'harbor'