emmi_inference.cli

Attributes

Functions

main([debug])

CLI entry hook to configure logging and ensure loaders are registered.

run([config_path, model_type, model_path, device, ...])

Run inference based on the input config and the provided arguments.

Module Contents

emmi_inference.cli.RICH_MARKUP_MODE: Literal['markdown', 'rich'] = 'rich'
emmi_inference.cli.CONTEXT_SETTINGS
emmi_inference.cli.app
emmi_inference.cli.main(debug=typer.Option(False, '--debug', help='Enable debug logging'))

CLI entry hook to configure logging and ensure loaders are registered.

Parameters:

debug (bool) – If True, enables verbose logging and leaves third-party logs unsuppressed. If False, reduces external noise.

Return type:

None

emmi_inference.cli.run(config_path=typer.Argument(...), model_type=typer.Argument(...), model_path=typer.Argument(..., exists=True, dir_okay=False, file_okay=True, help='Path to model .pt/.pth/.th'), device=typer.Option(DeviceEnum.AUTO, '--device', '-d', case_sensitive=False), autocast=typer.Option(False, '--autocast/--no-autocast'), dtype=typer.Option(None, '--dtype', help='float16|bfloat16|float32|float64'), destination=typer.Option(None, '--destination', case_sensitive=True, help="Output destination. Can be a local path (e.g., './results') or a remote URI (e.g., 's3://bucket/key'). If not set, uses 'save_dir' from the config file for local-only output."), upload_mode=typer.Option(UploadMode.SPOOL, '--upload-mode', case_sensitive=False, help='Upload mode when --destination is set.'), remove_local_spool=typer.Option(False, '--remove-local-spool', help='Remove local spool/cache after successful upload.'), upload_batch_size=typer.Option(100, '--upload-batch-size', help="Batch size for 'spool' mode uploads."), upload_workers=typer.Option(8, '--upload-workers', help='Number of parallel upload workers.'))

Run inference based on the input config and the provided arguments.

Parameters:
  • config_path (pathlib.Path) – Path to config file (YAML) to use.

  • model_type (str) – A string name of the model type to use.

  • model_path (pathlib.Path) – Path to the model checkpoint.

  • device (emmi_inference.device.DeviceEnum) – Device to use. Defaults to “auto”.

  • autocast (bool) – Either or not autocast to be enabled. Works only for CUDA. Defaults to False.

  • dtype (str | None) – Datatype to use. Defaults to None.

  • destination (str | None) – Output destination. Can be a local path (e.g., ‘./results’) or a remote URI (e.g., ‘s3://bucket/key’). If not set, uses ‘save_dir’ from the config file for local-only output.

  • upload_mode (emmi_inference.UploadMode) – Upload mode when destination is set. Defaults to ‘spool’.

  • remove_local_spool (bool) – Remove local spool/cache after successful upload.

  • upload_batch_size (int) – Batch size for ‘spool’ mode uploads.

  • upload_workers (int) – Number of parallel upload workers.

Return type:

None