Skip to main content

ClikaRT::processor::Processor

class

Header: ClikaRT/processor/processor.h

A multimodal preprocessor bundle: the OPTIONAL per-modality sub-processors a model directory provides (a tokenizer + one media processor: audio / image / video). Move-only.

from_huggingface auto-detects what is present (it inspects the directory's files; it is model-neutral). The has_* predicates report which slots filled, i.e. which components this model carries. Every fallible operation returns Result<T>; the library never throws.

Static member functions​

from_huggingface()​

static Processor from_huggingface(
    std::string_view path,
    StreamOrDevice where = {},
    ClikaRT::Span<const std::string_view> consumed_keys = {}
)

Load a HuggingFace model directory: the tokenizer (any artifact) + the one media processor preprocessor_config.json describes. where binds the default placement for the media processor. path is copied, not retained. Missing pieces leave their slot empty (not an error).

consumed_keys names top-level config keys the caller consumes above the IMAGE processor (a model's own tiling or geometry keys); they join the image parse's recognized set, so a clean load logs no unknown-key warning. Keys neither recognized nor named still warn. Read during the call, not retained.

Declared in ClikaRT/processor/processor.h, line 493

from_directory()​

static Processor from_directory(std::string_view path, StreamOrDevice where = {})

Load from a model directory, detecting the format present (currently HuggingFace). path is copied, not retained.

Declared in ClikaRT/processor/processor.h, line 498

Member functions​

Processor()​

Processor(Processor&&) noexcept

move-construct (the source becomes an empty shell)

Declared in ClikaRT/processor/processor.h, line 500

operator=()​

Processor& operator=(Processor&&) noexcept

move-assign

Declared in ClikaRT/processor/processor.h, line 501

~Processor()​

~Processor()

destructor

Declared in ClikaRT/processor/processor.h, line 502

has_tokenizer()​

bool has_tokenizer() const noexcept

Which components the loaded model directory carries.

Declared in ClikaRT/processor/processor.h, line 505

has_audio_processor()​

bool has_audio_processor() const noexcept

an audio processor is present

Declared in ClikaRT/processor/processor.h, line 506

has_image_processor()​

bool has_image_processor() const noexcept

an image processor is present

Declared in ClikaRT/processor/processor.h, line 507

has_video_processor()​

bool has_video_processor() const noexcept

a video processor is present

Declared in ClikaRT/processor/processor.h, line 508

tokenizer()​

tokenizer::Tokenizer tokenizer() const

The tokenizer this model directory shipped, with the special-token ids its config named (media processors keep the placement bound at load).

Declared in ClikaRT/processor/processor.h, line 519

audio_processor()​

AudioProcessor audio_processor() const

The audio processor: a standalone handle sharing the composite's instance (stays valid past this Processor).

Throws

Declared in ClikaRT/processor/processor.h, line 526

image_processor()​

ImageProcessor image_processor() const

The image processor: same sharing and lifetime as audio_processor.

Throws

Declared in ClikaRT/processor/processor.h, line 532

video_processor()​

VideoProcessor video_processor() const

The video processor: same sharing and lifetime as audio_processor.

Throws

Declared in ClikaRT/processor/processor.h, line 538