Skip to content

Commit

Permalink
char
Browse files Browse the repository at this point in the history
  • Loading branch information
Wovchena committed May 28, 2024
1 parent dc885bb commit 6856b5e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/cpp/src/llm_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/python/py_generate_pipeline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 8 additions & 0 deletions tests/python_tests/test_generate_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6856b5e

Please sign in to comment.