Skip to content

Commit be4a3db

Browse files
committed
install openvino_tokenizers for genai_python_lib
1 parent aa90e9d commit be4a3db

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

.github/workflows/genai_python_lib.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,25 @@ jobs:
1616
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
1717
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
1818
- run: python -m pip install --pre openvino --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly # Can't load CentOS libraries from the archive
19+
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
1920
- run: PYTHONPATH=./src/python/ python -c "from openvino_genai import LLMPipeline"
2021
- run: source ./ov/setupvars.sh && python -m pip install --pre . --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
21-
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
2222
- run: python -c "from openvino_genai import LLMPipeline"
23+
- name: check paths
24+
run: |
25+
python -c "
26+
import openvino_genai
27+
print("openvino_genai path: ", openvino_genai.__path__)
28+
import openvino_tokenizers
29+
print("openvino_tokenizers path: ", openvino_tokenizers.__path__)
30+
"
2331
- name: GenAI Python API tests
2432
run: |
2533
source ./ov/setupvars.sh
26-
cd ./tests/
34+
cd ./tests/python_tests/
2735
python -m pip install -r requirements.txt
28-
models=$(python3 generate_models.py)
36+
models=$(python list_test_models.py)
2937
echo "$models" | while read -r model_name model_path; do
30-
echo "Processing model: $model_name at $model_path"
3138
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model "$model_name" "$model_path"
3239
done
3340
python -m pytest test_generate_api.py
@@ -49,6 +56,7 @@ jobs:
4956
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
5057
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && cmake --build ./build/ --config Release -j
5158
- run: python -m pip install "numpy<1.27"
59+
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
5260
- run: set "PYTHONPATH=./src/python;" && call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -c "from openvino_genai import LLMPipeline" # cmd evaluates variables in a different way. Setting PYTHONPATH before setupvars.bat instead of doing that after solves that.
53-
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install .
61+
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install .
5462
- run: python -c "from openvino_genai import LLMPipeline"

tests/python_tests/list_test_models.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
# generate_models.py
2-
31
def models_list():
42
model_ids = [
53
("TinyLlama/TinyLlama-1.1B-Chat-v1.0", "TinyLlama-1.1B-Chat-v1.0"),
6-
("google/gemma-2b-it", "gemma-2b-it"),
7-
("google/gemma-7b-it", "gemma-7b-it"),
4+
# ("google/gemma-2b-it", "gemma-2b-it"),
5+
# ("google/gemma-7b-it", "gemma-7b-it"),
86
# ("meta-llama/Llama-2-7b-chat-hf", "Llama-2-7b-chat-hf"),
97
# ("meta-llama/Llama-2-13b-chat-hf", "Llama-2-13b-chat-hf"),
108
# ("openlm-research/open_llama_3b", "open_llama_3b"),

tests/python_tests/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
pytest
22
transformers
3-
torch
3+
torch
4+
optimum-intel[openvino] @ git+https://github.com/huggingface/optimum-intel.git@fb1b35bef23242d65b2fb057c4a7ac78a7cfd4c3

0 commit comments

Comments
 (0)