diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index 91efccf315..e0151376b4 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -49,8 +49,6 @@ add_library(${TARGET_NAME} SHARED ${SOURCE_FILES}) add_library(openvino::${TARGET_NAME} ALIAS ${TARGET_NAME}) target_include_directories(${TARGET_NAME} - # TODO: remove it, because beam_search algo should not be exposed to end users - PRIVATE "$" PUBLIC "$" "$") target_link_libraries(${TARGET_NAME} PUBLIC openvino::runtime PRIVATE nlohmann_json::nlohmann_json jinja2cpp) @@ -66,6 +64,13 @@ add_custom_command(TARGET ${TARGET_NAME} POST_BUILD "${CMAKE_CURRENT_SOURCE_DIR}/../python/openvino_genai/$" COMMENT "Copy ${TARGET_NAME} to src/python/openvino_genai") +# Copy libcore_tokenizers.so to build_dir/openvino_tokenizers/src/ +add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/lib/libcore_tokenizers.so" + "${CMAKE_BINARY_DIR}/openvino_tokenizers/src/" + COMMENT "Copy libcore_tokenizers.so to build_dir/openvino_tokenizers/src/") + install(TARGETS ${TARGET_NAME} LIBRARY DESTINATION . COMPONENT core_genai RUNTIME DESTINATION . COMPONENT core_genai) # - Windows: `\runtime\bin\intel64\Release\` diff --git a/src/cpp/src/group_beam_searcher.cpp b/src/cpp/src/group_beam_searcher.cpp index 1e27f36a0a..312671c8f0 100644 --- a/src/cpp/src/group_beam_searcher.cpp +++ b/src/cpp/src/group_beam_searcher.cpp @@ -2,8 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 #include -#include "group_beam_searcher.hpp" #include "generation_config_helper.hpp" +#include "openvino/genai/llm_pipeline.hpp" #include "utils.hpp" namespace { diff --git a/src/cpp/src/group_beam_searcher.hpp b/src/cpp/src/group_beam_searcher.hpp deleted file mode 100644 index 5362c9cfae..0000000000 --- a/src/cpp/src/group_beam_searcher.hpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2023-2024 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 - -#pragma once - -#include -#include "openvino/genai/generation_config.hpp" -#include "openvino/genai/llm_pipeline.hpp" - -namespace ov { - EncodedResults beam_search(ov::InferRequest& lm, ov::Tensor prompts, ov::Tensor attentin_mask, GenerationConfig config); -} diff --git a/src/cpp/src/llm_pipeline.cpp b/src/cpp/src/llm_pipeline.cpp index 4415e507fe..9ea685e583 100644 --- a/src/cpp/src/llm_pipeline.cpp +++ b/src/cpp/src/llm_pipeline.cpp @@ -14,7 +14,6 @@ #include "openvino/genai/llm_pipeline.hpp" #include "utils.hpp" #include "generation_config_helper.hpp" -#include "group_beam_searcher.hpp" #include "text_callback_streamer.hpp" @@ -29,6 +28,8 @@ ov::EncodedResults greedy_decoding( bool is_chat_conversation = false ); +EncodedResults beam_search(ov::InferRequest& lm, ov::Tensor prompts, ov::Tensor attentin_mask, GenerationConfig config); + class LLMPipeline::LLMPipelineImpl { public: diff --git a/tests/python_tests/test_generate_api.py b/tests/python_tests/test_generate_api.py index d0bec03107..1d46e227c9 100644 --- a/tests/python_tests/test_generate_api.py +++ b/tests/python_tests/test_generate_api.py @@ -28,10 +28,10 @@ def run_hf_ov_genai_comparison(model_fixture, generation_config, prompt): hf_output = tokenizer.decode(hf_encoded_output[0, encoded_prompt.shape[1]:]) device = 'CPU' - ov_tokenziers_path = '../../build/openvino_tokenizers/src/' + ov_tokenizers_path = '../../build/openvino_tokenizers/src/' import openvino_genai as ov_genai - pipe = ov_genai.LLMPipeline(path, device, {}, ov_tokenziers_path) + pipe = ov_genai.LLMPipeline(path, device, {}, ov_tokenizers_path) ov_output = pipe.generate(prompt, **generation_config) if hf_output != ov_output: