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 491
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 496
Member functions
Processor()
Processor(Processor&&) noexcept
move-construct (the source becomes an empty shell)
Declared in ClikaRT/processor/processor.h, line 498
operator=()
move-assign
Declared in ClikaRT/processor/processor.h, line 499
~Processor()
~Processor()
destructor
Declared in ClikaRT/processor/processor.h, line 500
has_tokenizer()
bool has_tokenizer() const noexcept
Which components the loaded model directory carries.
Declared in ClikaRT/processor/processor.h, line 503
has_audio_processor()
bool has_audio_processor() const noexcept
an audio processor is present
Declared in ClikaRT/processor/processor.h, line 504
has_image_processor()
bool has_image_processor() const noexcept
an image processor is present
Declared in ClikaRT/processor/processor.h, line 505
has_video_processor()
bool has_video_processor() const noexcept
a video processor is present
Declared in ClikaRT/processor/processor.h, line 506
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 517
audio_processor()
AudioProcessor audio_processor() const
The audio processor: a standalone handle sharing the composite's instance (stays valid past this Processor).
Throws
ClikaRT::Error: (NotFound) when the model directory shipped none; checkhas_audio_processor()first.
Declared in ClikaRT/processor/processor.h, line 524
image_processor()
ImageProcessor image_processor() const
The image processor: same sharing and lifetime as audio_processor.
Throws
ClikaRT::Error: (NotFound) when the slot is empty; checkhas_image_processor()first.
Declared in ClikaRT/processor/processor.h, line 530
video_processor()
VideoProcessor video_processor() const
The video processor: same sharing and lifetime as audio_processor.
Throws
ClikaRT::Error: (NotFound) when the slot is empty; checkhas_video_processor()first.
Declared in ClikaRT/processor/processor.h, line 536