MCPcopy Create free account
hub / github.com/agentscope-ai/Trinity-RFT / __init__

Method __init__

trinity/explorer/workflow_runner.py:443–485  ·  view source on GitHub ↗
(
        self,
        config: Config,
        output_dir: str = "debug_output",
        enable_profiling: bool = False,
        disable_overwrite: bool = False,
    )

Source from the content-addressed store, hash-verified

441 """A WorkflowRunner for debugging."""
442
443 def __init__(
444 self,
445 config: Config,
446 output_dir: str = "debug_output",
447 enable_profiling: bool = False,
448 disable_overwrite: bool = False,
449 ) -> None:
450 if disable_overwrite:
451 # if output dir is not empty, change to a new dir with datetime suffix
452 if os.path.isdir(output_dir) and os.listdir(output_dir):
453 suffix = time.strftime("%Y%m%d%H%M%S", time.localtime())
454 output_dir = f"{output_dir}_{suffix}"
455 os.environ[LOG_DIR_ENV_VAR] = os.path.join(output_dir, "log")
456 os.environ[LOG_LEVEL_ENV_VAR] = "DEBUG"
457 super().__init__(
458 config=config,
459 rollout_model_id=0,
460 auxiliary_model_ids=[0] * len(config.explorer.auxiliary_models),
461 runner_id=0,
462 )
463 self.taskset = get_buffer_reader(config.buffer.explorer_input.tasksets[0])
464 self.output_dir = output_dir
465 self.enable_profiling = enable_profiling
466 self.logger.info(f"Debug output directory: {self.output_dir}")
467 os.makedirs(self.output_dir, exist_ok=True)
468 self.output_profiling_file = os.path.join(
469 self.output_dir,
470 "profiling.html",
471 )
472 self.output_sqlite_file = "sqlite:///" + os.path.join(
473 self.output_dir,
474 "experiences.db",
475 )
476 self.sqlite_writer = get_buffer_writer(
477 StorageConfig(
478 name="debug_buffer",
479 schema_type="experience",
480 path=self.output_sqlite_file,
481 storage_type="sql",
482 batch_size=1,
483 wrap_in_ray=False,
484 )
485 )
486
487 async def debug(self) -> None:
488 """Run the debug workflow."""

Callers

nothing calls this directly

Calls 4

get_buffer_readerFunction · 0.90
get_buffer_writerFunction · 0.90
StorageConfigClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected