From d46f594800a8bf79c407644222b0e6203eb9512c Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 8 Nov 2023 20:37:13 +0800 Subject: [PATCH 1/3] Added include dir to nlohmann headers --- .../user_ie_extensions/tokenizer/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) 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) From 6f213ab7a8253611b5458ee9ae7dfe9448d5325b Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 8 Nov 2023 16:53:18 +0400 Subject: [PATCH 2/3] Fixed compilation on ubuntu 18.04 arm64 --- .../user_ie_extensions/tokenizer/vocab_decoder.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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}); From 6ed52e471541f97e4fd7c4cdae79c3fca1fb9167 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 8 Nov 2023 17:22:17 +0400 Subject: [PATCH 3/3] Fixed Windows --- .../user_ie_extensions/tokenizer/string_tensor_unpack.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) {