diff --git a/src/cpp/src/llm_pipeline.cpp b/src/cpp/src/llm_pipeline.cpp index 6611b8d0c..ce3d22365 100644 --- a/src/cpp/src/llm_pipeline.cpp +++ b/src/cpp/src/llm_pipeline.cpp @@ -86,13 +86,13 @@ std::string from_tokenizer_json_if_exists(const std::string& path) { std::filesystem::path with_openvino_tokenizers(const std::filesystem::path& path) { // There can be more than one . but std::filesystem::path::extension() would return the last one. #ifdef _WIN32 - constexpr tokenizers = "openvino_tokenizers.dll"; + constexpr char tokenizers[] = "openvino_tokenizers.dll"; #elif __linux__ - constexpr tokenizers = "openvino_tokenizers.so"; + constexpr char tokenizers[] = "openvino_tokenizers.so"; #elif __APPLE__ - constexpr tokenizers = "openvino_tokenizers.dylib"; + constexpr char tokenizers[] = "openvino_tokenizers.dylib"; #endif - return path.parent_path() / ("openvino_tokenizers" + ext); + return path.parent_path() / tokenizers; } std::string get_ov_genai_library_path() { diff --git a/src/python/py_generate_pipeline.cpp b/src/python/py_generate_pipeline.cpp index c6a78ae12..a36e21808 100644 --- a/src/python/py_generate_pipeline.cpp +++ b/src/python/py_generate_pipeline.cpp @@ -100,13 +100,13 @@ std::string call_with_config(LLMPipeline& pipe, const std::string& text, const G std::filesystem::path with_openvino_tokenizers(const std::filesystem::path& path) { // There can be more than one . but std::filesystem::path::extension() would return the last one. #ifdef _WIN32 - constexpr tokenizers = "openvino_tokenizers.dll"; + constexpr char tokenizers[] = "openvino_tokenizers.dll"; #elif __linux__ - constexpr tokenizers = "openvino_tokenizers.so"; + constexpr char tokenizers[] = "openvino_tokenizers.so"; #elif __APPLE__ - constexpr tokenizers = "openvino_tokenizers.dylib"; + constexpr char tokenizers[] = "openvino_tokenizers.dylib"; #endif - return path.parent_path() / ("openvino_tokenizers" + ext); + return path.parent_path() / tokenizers; } std::string get_ov_genai_bindings_path() { diff --git a/tests/python_tests/test_generate_api.py b/tests/python_tests/test_generate_api.py index 5ac977f1b..eaaf0ddc9 100644 --- a/tests/python_tests/test_generate_api.py +++ b/tests/python_tests/test_generate_api.py @@ -54,6 +54,14 @@ def stop_criteria_map(): # (dict(num_beam_groups=2, num_beams=8, num_return_sequences=8, max_new_tokens=20, diversity_penalty=1.0), 'The Sun is yellow because'), # (dict(num_beam_groups=2, num_beams=8, num_return_sequences=8, max_new_tokens=20, diversity_penalty=1.5), 'The Sun is yellow because'), ] + + +def test_short(): + import openvino_genai + openvino_genai.LLMPipeline(r'C:\Users\vzlobin\r\g\TinyLlama-1.1B-Chat-v1.0', 'CPU', {}) + openvino_genai.LLMPipeline(r'C:\Users\vzlobin\r\g\TinyLlama-1.1B-Chat-v1.0', 'CPU', {}, '') + + @pytest.mark.parametrize("generation_config,prompt", test_cases) def test_greedy_decoding(model_fixture, generation_config, prompt): run_hf_ov_genai_comparison(model_fixture, generation_config, prompt)