Skip to content

Commit

Permalink
install openvino_tokenizers for genai_python_lib
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed May 22, 2024
1 parent aa90e9d commit 2b75848
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/genai_python_lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@ jobs:
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j
- 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
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
- run: PYTHONPATH=./src/python/ python -c "from openvino_genai import LLMPipeline"
- run: source ./ov/setupvars.sh && python -m pip install --pre . --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/nightly
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
- run: python -c "from openvino_genai import LLMPipeline"
- name: GenAI Python API tests
run: |
source ./ov/setupvars.sh
cd ./tests/
cd ./tests/python_tests/
python -m pip install -r requirements.txt
models=$(python3 generate_models.py)
models=$(python list_test_models.py)
echo "$models" | while read -r model_name model_path; do
echo "Processing model: $model_name at $model_path"
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model "$model_name" "$model_path"
done
python -m pytest test_generate_api.py
Expand All @@ -49,6 +48,7 @@ jobs:
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && cmake --build ./build/ --config Release -j
- run: python -m pip install "numpy<1.27"
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers]
- 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.
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install .
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240515_x86_64\setupvars.bat && python -m pip install .
- run: python -c "from openvino_genai import LLMPipeline"
6 changes: 2 additions & 4 deletions tests/python_tests/list_test_models.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# generate_models.py

def models_list():
model_ids = [
("TinyLlama/TinyLlama-1.1B-Chat-v1.0", "TinyLlama-1.1B-Chat-v1.0"),
("google/gemma-2b-it", "gemma-2b-it"),
("google/gemma-7b-it", "gemma-7b-it"),
# ("google/gemma-2b-it", "gemma-2b-it"),
# ("google/gemma-7b-it", "gemma-7b-it"),
# ("meta-llama/Llama-2-7b-chat-hf", "Llama-2-7b-chat-hf"),
# ("meta-llama/Llama-2-13b-chat-hf", "Llama-2-13b-chat-hf"),
# ("openlm-research/open_llama_3b", "open_llama_3b"),
Expand Down
3 changes: 2 additions & 1 deletion tests/python_tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pytest
transformers
torch
torch
optimum-intel[openvino] @ git+https://github.com/huggingface/optimum-intel.git@fb1b35bef23242d65b2fb057c4a7ac78a7cfd4c3

0 comments on commit 2b75848

Please sign in to comment.