mutterkey
KDE-first push-to-talk transcription tool for KDE Plasma
Loading...
Searching...
No Matches
cpureferencemodel.h
Go to the documentation of this file.
1#pragma once
2
6
7#include <array>
8#include <cstdint>
9#include <memory>
10#include <optional>
11
22 std::array<char, 8> magic{};
24 std::uint32_t version = 0;
26 std::uint32_t transcriptBytes = 0;
27};
28
34 QString transcript;
35};
36
41{
42public:
50
51 [[nodiscard]] QString backendName() const override;
52 [[nodiscard]] ModelMetadata metadata() const override;
53 [[nodiscard]] QString modelDescription() const override;
54
59 [[nodiscard]] const QString &transcript() const;
60
61private:
62 ValidatedModelPackage m_package;
64 qint64 m_loadTimeMs = 0;
65};
66
73[[nodiscard]] std::shared_ptr<const CpuReferenceModelHandle>
75
81[[nodiscard]] std::shared_ptr<const CpuReferenceModelHandle>
82resolveCpuReferenceModelHandle(std::shared_ptr<const TranscriptionModelHandle> model);
Immutable loaded native CPU model handle owned by the runtime.
CpuReferenceModelHandle(ValidatedModelPackage package, CpuReferenceModelData model, qint64 loadTimeMs)
Creates an immutable native CPU reference model handle.
const QString & transcript() const
Returns the deterministic transcript fixture embedded in this model.
QString modelDescription() const override
Returns a human-readable description of the loaded model.
ModelMetadata metadata() const override
Returns product-owned immutable metadata for the loaded artifact.
QString backendName() const override
Returns the backend identifier for this loaded model.
Immutable loaded-model interface created by a transcription engine.
std::shared_ptr< const CpuReferenceModelHandle > resolveCpuReferenceModelHandle(std::shared_ptr< const TranscriptionModelHandle > model)
Downcasts a generic model handle to the native CPU reference handle type.
std::shared_ptr< const CpuReferenceModelHandle > loadCpuReferenceModelHandle(const ValidatedModelPackage &package, RuntimeError *error=nullptr)
Loads a native CPU reference model handle from a validated package.
Product-owned model package manifest and validated package value types.
Deterministic native CPU reference model payload loaded from disk.
QString transcript
Final transcript emitted by the deterministic reference runtime fixture.
Fixed header stored at the start of a native CPU reference weights asset.
std::array< char, 8 > magic
File-format magic. Kept ASCII for stable inspection and tests.
std::uint32_t transcriptBytes
UTF-8 transcript payload size used by the deterministic reference fixture format.
std::uint32_t version
Native CPU reference weights format version.
Product-owned immutable metadata about a validated model artifact.
Structured runtime-layer failure with user-facing and diagnostic text.
Fully validated model package resolved from disk.
Stable engine/session boundary for embedded transcription backends.
Shared value types exchanged by the transcription pipeline.