29#include "grammar-parser.h"
33#define WHISPER_LOG_ERROR(text, ...) \
34 fprintf(stderr, "[ERROR] " text "\n", ##__VA_ARGS__)
35#define WHISPER_LOG_WARN(text, ...) \
36 fprintf(stderr, "[WARN] " text "\n", ##__VA_ARGS__)
37#define WHISPER_LOG_INFO(text, ...) \
38 fprintf(stderr, "[INFO] " text "\n", ##__VA_ARGS__)
50 Whisper(
const std::string &model,
const std::string &openvino_encode_device,
51 int n_processors,
const struct whisper_context_params &cparams,
52 const struct whisper_full_params &
wparams);
56 std::string
trim(const std::string &s);
59 bool
set_grammar(const std::string grammar, const std::string start_rule,
60 float grammar_penalty);
69 struct whisper_context *
ctx;
Definition whisper.hpp:47
Whisper(const std::string &model, const std::string &openvino_encode_device, int n_processors, const struct whisper_context_params &cparams, const struct whisper_full_params &wparams)
Definition whisper.cpp:31
grammar_parser::parse_state grammar_parsed
Definition whisper.hpp:70
void reset_grammar()
Definition whisper.cpp:157
struct whisper_full_params wparams
Definition whisper.hpp:67
struct transcription_output transcribe(const std::vector< float > &pcmf32)
Definition whisper.cpp:76
int n_processors
Definition whisper.hpp:66
bool set_grammar(const std::string grammar, const std::string start_rule, float grammar_penalty)
Definition whisper.cpp:137
~Whisper()
Definition whisper.cpp:73
void reset_init_prompt()
Definition whisper.cpp:168
std::string trim(const std::string &s)
Definition whisper.cpp:116
struct whisper_context * ctx
Definition whisper.hpp:69
std::vector< const whisper_grammar_element * > grammar_rules
Definition whisper.hpp:71
std::string timestamp_to_str(int64_t t, bool comma=false)
Definition whisper.cpp:121
void set_init_prompt(const std::string prompt)
Definition whisper.cpp:164
Definition whisper.hpp:45
Definition whisper.hpp:40
std::string text
Definition whisper.hpp:41
float prob
Definition whisper.hpp:42