watcher.watcher_api package
- watcher.watcher_api.start_simulators(blueprint: str, log_dir: str, gpu_ids: list[str], n_preprocess_workers: int, db_schema: str = 'public', max_batch_size: int = 256, max_length: int = 10000, return_generated_parts_only: bool = True, return_unfinished: bool = False) Flask [source]
- Starts all background simulator processes including:
Preprocessing workers
WatcherOrchestrator
Expiration manager
This function should be called separately from the Flask app, typically before launching Gunicorn or from a separate process.
Example Usage
from watcher.watcher_api import start_simulators start_simulators(...)
- Parameters:
blueprint (str) – Model blueprint name.
log_dir (str) – Path to directory for saving logs.
gpu_ids (list[str]) – List of GPU device IDs to assign for simulation.
n_preprocess_workers (int) – Number of multiprocessing workers for data preprocessing.
db_schema (str, optional) – PostgreSQL schema name. Defaults to “public”.
max_batch_size (int, optional) – Max batch size for simulation. Defaults to 256.
max_length (int, optional) – Max sequence length for simulation input. Defaults to 10000.
return_generated_parts_only (bool, optional) – If True, returns only generated output. Defaults to True.
return_unfinished (bool, optional) – If True, includes unfinished trajectories. Defaults to False.