mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-08-17 01:01:43 +02:00
whisper : add OpenVINO support (#1037)
* openvino: use OpenVINO encoder inference * openvino: add python script for OpenVINO model generation * whisper: Fix 'unused' warnings when OpenVINO isn't enabled in build * Apply suggestions from code review Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> * whisper: Fix compilation error * whisper: revert whisper_get_openvino_path_encoder & whisper_get_openvino_path_cache to non-const func signatures * cmake: Add openvino-encoder as separate object target * whisper : minor style fixes * minor : indentation fixes --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
31
openvino/whisper-openvino-encoder.h
Normal file
31
openvino/whisper-openvino-encoder.h
Normal file
@ -0,0 +1,31 @@
|
||||
// Wrapper of the OpenVINO Whisper Encoder model
|
||||
//
|
||||
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct whisper_openvino_context;
|
||||
|
||||
// initialize openvino encoder, given path to model xml, device ("CPU", "GPU", etc.), and
|
||||
// path to cache_dir. Returns null upon failure.
|
||||
struct whisper_openvino_context * whisper_openvino_init(const char * path_model,
|
||||
const char * device,
|
||||
const char * cache_dir);
|
||||
|
||||
// clean up a ctx previously returned from whisper_openvino_init()
|
||||
void whisper_openvino_free(struct whisper_openvino_context * ctx);
|
||||
|
||||
struct ggml_tensor;
|
||||
|
||||
// Perform encode using OpenVINO.
|
||||
// Returns 1 on success
|
||||
// Returns 0 on failure
|
||||
int whisper_openvino_encode(
|
||||
whisper_openvino_context* ctx,
|
||||
ggml_tensor* mel,
|
||||
ggml_tensor* out);
|
||||
|
||||
#if __cplusplus
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user