Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVINO support #1037

Merged
merged 10 commits into from
Jul 4, 2023
14 changes: 8 additions & 6 deletions whisper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2639,25 +2639,27 @@ static std::string whisper_get_coreml_path_encoder(std::string path_bin) {
#ifdef WHISPER_USE_OPENVINO
// replace .bin with-encoder-openvino.xml
static std::string whisper_get_openvino_path_encoder(const std::string & path_bin) {
std::string openvino_path_encoder;
auto pos = path_bin.rfind('.');
if (pos != std::string::npos) {
path_bin = path_bin.substr(0, pos);
openvino_path_encoder = path_bin.substr(0, pos);
}

path_bin += "-encoder-openvino.xml";
openvino_path_encoder += "-encoder-openvino.xml";

return path_bin;
return openvino_path_encoder;
}

static std::string whisper_get_openvino_path_cache(const std::string & path_bin) {
std::string openvino_path_cache;
auto pos = path_bin.rfind('.');
if (pos != std::string::npos) {
path_bin = path_bin.substr(0, pos);
openvino_path_cache = path_bin.substr(0, pos);
}

path_bin += "-encoder-openvino-cache";
openvino_path_cache += "-encoder-openvino-cache";

return path_bin;
return openvino_path_cache;
ggerganov marked this conversation as resolved.
Show resolved Hide resolved
}
#endif

Expand Down