Skip to content

Exporter

siglip2_toolkit.exporter.ExportConfig dataclass

ExportConfig(
    input_dirs=(),
    output_file="embeddings.jsonl",
    output_format=None,
    model=None,
    home=None,
    device=None,
    batch_size=32,
    incremental=False,
    source_file=None,
    store_metadata=True,
    create_thumbnails=False,
    thumbnail_dir="thumbnails",
    thumbnail_size=(128, 128),
)

Configuration for a single export run.

siglip2_toolkit.exporter.ExportResult dataclass

ExportResult(
    processed=0,
    skipped=0,
    removed=0,
    total=0,
    output_file="",
    embedding_space=None,
)

Summary of an export run.

siglip2_toolkit.exporter.Exporter

Exporter(
    config, embedder=None, on_progress=None, on_stage=None
)

Runs the export workflow for one configuration.

Progress can be followed with two callbacks: on_progress(done, total, path) after each processed batch and on_stage(stage) for coarse phase changes ("scanning", "embedding", "done").

With incremental enabled, only new or modified files are embedded and deleted files are dropped from the export. Modification detection relies on file metadata, so store_metadata=False limits incremental runs to new/deleted files.

embedder property

embedder

The embedder to use, created from the config if none was provided.

run

run()

Execute the run and return its summary.