Skip to content

Commit

Permalink
Merge pull request #3 from ilya-lavrenov/nlohmann
Browse files Browse the repository at this point in the history
Added include dir to nlohmann headers
  • Loading branch information
apaniukov authored Nov 8, 2023
2 parents ce25397 + 6ed52e4 commit ca62321
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> token = std::vector(vocab_chars + vocab_begins[id], vocab_chars + vocab_ends[id]);
vocab[id] = token;
vocab[id] = std::vector<uint8_t>(vocab_chars + vocab_begins[id], vocab_chars + vocab_ends[id]);
}
// Set output shapes
outputs[0].set_shape({batch_size});
Expand Down

0 comments on commit ca62321

Please sign in to comment.