#pragma once
#include "ggml-backend.h"
#include "ggml.h"
#include "transcribe-backend.h"
#include "transcribe-load-common.h"
#include "transcribe-mel.h"
#include "transcribe-model.h"
#include "transcribe-session.h"
#include "transcribe-tokenizer.h"
#include "weights.h"
#include <cstdint>
#include <optional>
#include <string>
#include <vector>
struct ggml_context;
struct ggml_tensor;
typedef struct ggml_backend * ggml_backend_t;
typedef struct ggml_backend_buffer * ggml_backend_buffer_t;
typedef struct ggml_backend_sched * ggml_backend_sched_t;
namespace transcribe::granite5_ctc {
void apply_family_invariants(transcribe_model & model);
struct Granite5CtcModel final : public transcribe_model {
Tokenizer tok;
Granite5CtcHParams hparams;
Granite5CtcWeights weights;
ggml_context * ctx_meta = nullptr;
transcribe::BackendPlan plan;
transcribe::load_common::WeightStorage weight_storage;
ggml_context * bn_fused_ctx = nullptr;
ggml_backend_buffer_t bn_fused_buffer = nullptr;
std::optional<transcribe::MelFrontend> mel;
Granite5CtcModel() = default;
~Granite5CtcModel() override;
const transcribe::Tokenizer * tokenizer() const override { return &tok; }
};
struct Granite5CtcSession final : public transcribe_session {
std::vector<float> feats_buf; std::vector<float> logits_buf;
Granite5CtcSession() = default;
~Granite5CtcSession() override;
};
}