diff --git a/modules/custom_operations/user_ie_extensions/tokenizer/CMakeLists.txt b/modules/custom_operations/user_ie_extensions/tokenizer/CMakeLists.txt index 5b13dcabc..0d0cb7053 100644 --- a/modules/custom_operations/user_ie_extensions/tokenizer/CMakeLists.txt +++ b/modules/custom_operations/user_ie_extensions/tokenizer/CMakeLists.txt @@ -65,6 +65,7 @@ target_include_directories(${TARGET_NAME} PRIVATE # fast_tokenizer "${fast_tokenizer_SOURCE_DIR}/fast_tokenizer" "${CMAKE_BINARY_DIR}/third_party/dart/src/extern_dart/include/" + "${CMAKE_BINARY_DIR}/third_party/json/src/extern_json/single_include/" "${CMAKE_BINARY_DIR}/third_party/install/re2/include/") if(CMAKE_CL_64) diff --git a/modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_unpack.cpp b/modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_unpack.cpp index ec9e22bb5..bd1320f44 100644 --- a/modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_unpack.cpp +++ b/modules/custom_operations/user_ie_extensions/tokenizer/string_tensor_unpack.cpp @@ -25,15 +25,18 @@ void StringTensorUnpack::validate_and_infer_types() { // - when string tensor is passed and we are after the hack in CPU (element::u8) and // - when stirng tensor is not really used, and we expect a packed string tensor in this case (element::u8) - OPENVINO_ASSERT( #if OPENVINO_ELEMENT_STRING_SUPPORTED + OPENVINO_ASSERT( get_input_element_type(0) == element::string || + get_input_element_type(0) == element::dynamic, + "Type of StringTensorUnpack input is expected to be element::string before a model compilation or element::u8 after the compilation or when element::string is not supported"); #endif #if OPENVINO_USE_INPUT_OUTPUT_STRING_TENSOR_HACK || !USE_STRING_TENSORS + OPENVINO_ASSERT( get_input_element_type(0) == element::u8 || -#endif get_input_element_type(0) == element::dynamic, "Type of StringTensorUnpack input is expected to be element::string before a model compilation or element::u8 after the compilation or when element::string is not supported"); +#endif #if OPENVINO_ELEMENT_STRING_SUPPORTED if(get_input_element_type(0) == element::string) { diff --git a/modules/custom_operations/user_ie_extensions/tokenizer/vocab_decoder.cpp b/modules/custom_operations/user_ie_extensions/tokenizer/vocab_decoder.cpp index 310bd99fa..1d173abce 100644 --- a/modules/custom_operations/user_ie_extensions/tokenizer/vocab_decoder.cpp +++ b/modules/custom_operations/user_ie_extensions/tokenizer/vocab_decoder.cpp @@ -33,8 +33,7 @@ bool VocabDecoder::evaluate(ov::TensorVector& outputs, const ov::TensorVector& i OPENVINO_ASSERT(inputs.size() == 4, "Too few inputs passed to VocabDecoder, it means it is not converted properly or it is not used in the supported pattern"); for(size_t id = 0; id < vocab_size; ++id) { - std::vector token = std::vector(vocab_chars + vocab_begins[id], vocab_chars + vocab_ends[id]); - vocab[id] = token; + vocab[id] = std::vector(vocab_chars + vocab_begins[id], vocab_chars + vocab_ends[id]); } // Set output shapes outputs[0].set_shape({batch_size});