diff --git a/src/cpp/src/llm_pipeline.cpp b/src/cpp/src/llm_pipeline.cpp index 26d6c3da8a..aff15d92be 100644 --- a/src/cpp/src/llm_pipeline.cpp +++ b/src/cpp/src/llm_pipeline.cpp @@ -98,7 +98,7 @@ std::filesystem::path with_openvino_tokenizers_stem(const std::filesystem::path& if (dot == std::string::npos) { ext = suffix; } else { - ext = suffix.substr(0, next_dot); + ext = suffix.substr(0, next_dot - 1); } return path.parent_path() / ("openvino_tokenizers" + ext); } diff --git a/src/python/py_generate_pipeline.cpp b/src/python/py_generate_pipeline.cpp index 296da0ba85..e8cc884bed 100644 --- a/src/python/py_generate_pipeline.cpp +++ b/src/python/py_generate_pipeline.cpp @@ -112,7 +112,7 @@ std::filesystem::path with_openvino_tokenizers_stem(const std::filesystem::path& if (dot == std::string::npos) { ext = suffix; } else { - ext = suffix.substr(0, next_dot); + ext = suffix.substr(0, next_dot - 1); } return path.parent_path() / ("openvino_tokenizers" + ext); }