11
11
12
12
#include " openvino/genai/text2image/pipeline.hpp"
13
13
14
+ #include " tokenizers_path.hpp"
14
15
#include " py_utils.hpp"
15
16
16
17
namespace py = pybind11;
@@ -21,6 +22,7 @@ void init_clip_text_model(py::module_& m) {
21
22
.def (py::init ([](
22
23
const std::filesystem::path& root_dir
23
24
) {
25
+ ScopedVar env_manager (pyutils::ov_tokenizers_module_path ());
24
26
return std::make_unique<ov::genai::CLIPTextModel>(root_dir);
25
27
}),
26
28
py::arg (" root_dir" ), " Model root directory" ,
@@ -33,6 +35,7 @@ void init_clip_text_model(py::module_& m) {
33
35
const std::string& device,
34
36
const py::kwargs& kwargs
35
37
) {
38
+ ScopedVar env_manager (pyutils::ov_tokenizers_module_path ());
36
39
return std::make_unique<ov::genai::CLIPTextModel>(root_dir, device, pyutils::kwargs_to_any_map (kwargs));
37
40
}),
38
41
py::arg (" root_dir" ), " Model root directory" ,
@@ -229,6 +232,7 @@ void init_clip_text_model_with_projection(py::module_& m) {
229
232
.def (py::init ([](
230
233
const std::filesystem::path& root_dir
231
234
) {
235
+ ScopedVar env_manager (pyutils::ov_tokenizers_module_path ());
232
236
return std::make_unique<ov::genai::CLIPTextModelWithProjection>(root_dir);
233
237
}),
234
238
py::arg (" root_dir" ), " Model root directory" ,
@@ -241,6 +245,7 @@ void init_clip_text_model_with_projection(py::module_& m) {
241
245
const std::string& device,
242
246
const py::kwargs& kwargs
243
247
) {
248
+ ScopedVar env_manager (pyutils::ov_tokenizers_module_path ());
244
249
return std::make_unique<ov::genai::CLIPTextModelWithProjection>(root_dir, device, pyutils::kwargs_to_any_map (kwargs));
245
250
}),
246
251
py::arg (" root_dir" ), " Model root directory" ,
0 commit comments