#pragma once
#include "ggml.h"
#include <vector>
struct ggml_context;
struct ggml_tensor;
struct ggml_cgraph;
namespace transcribe::moonshine {
struct MoonshineHParams;
struct MoonshineWeights;
struct EncoderDumps {
ggml_tensor * audio_in = nullptr;
ggml_tensor * conv1_out = nullptr; ggml_tensor * groupnorm_out = nullptr;
ggml_tensor * conv2_out = nullptr; ggml_tensor * conv3_out = nullptr; ggml_tensor * rope_cos = nullptr;
ggml_tensor * rope_sin = nullptr;
std::vector<ggml_tensor *> block_outs;
ggml_tensor * final_out = nullptr;
};
struct EncoderBuild {
ggml_tensor * audio_in = nullptr;
ggml_tensor * pos_ids_in = nullptr;
ggml_tensor * out = nullptr;
EncoderDumps dumps {};
ggml_cgraph * graph = nullptr;
int T_enc = 0;
};
int encoder_t_enc(const MoonshineHParams & hp, int n_samples);
EncoderBuild build_encoder_graph(ggml_context * compute_ctx,
const MoonshineWeights & weights,
const MoonshineHParams & hp,
int n_samples,
bool use_flash = true);
}