#include "ggml/ggml.h" #include "ggml/ggml-alloc.h" #include "math.h" #include "model_loader.h" #include "fairseq2.h" #include #include #include #include #include #include #include #include #include #include #include struct Result { std::vector transcription; std::vector word_confidence_scores; std::unordered_map lid_scores; int err; }; struct ggml_cgraph * unity_speech_encoder( fairseq2_model& model, struct ggml_tensor * speech_input); Hypothesis* unity_decode( fairseq2_model& model, const SequenceGeneratorOptions& opts, int tgt_lang_idx, ggml_tensor* encoder_output, int n_threads ); extern "C" fairseq2_model unity_init_model(const char* model_path); extern "C" Result unity_eval(fairseq2_model model, std::vector data, SequenceGeneratorOptions opts, std::string tgt_lang, int n_threads, int memory_gb);