Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JS] Add GenAI Node.js bindings #1193

Open
wants to merge 90 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 87 commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
0d73757
Add genai nodejs bindings
vishniakov-nikolai Nov 11, 2024
2d71b6b
Include js bindings into package build
vishniakov-nikolai Nov 13, 2024
0c0b41c
Put binaries at the top level of NPM package
vishniakov-nikolai Nov 15, 2024
7e80306
Skip samples for NPM package
vishniakov-nikolai Nov 15, 2024
67d5a40
Add model downloading into js unit tests
vishniakov-nikolai Nov 19, 2024
689e352
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Nov 19, 2024
4e3405a
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Nov 20, 2024
6853446
Set openvino_tokenizers on latest master
vishniakov-nikolai Nov 20, 2024
e433a19
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Nov 25, 2024
ae806da
Temporary disable most of gha wf to debug
vishniakov-nikolai Nov 26, 2024
8632882
Minify linux wf
vishniakov-nikolai Nov 26, 2024
9ceb3b5
Fix wf file
vishniakov-nikolai Nov 26, 2024
599713b
Fix wf file
vishniakov-nikolai Nov 26, 2024
222940d
Set cpack generator as NPM
vishniakov-nikolai Nov 26, 2024
901dd90
Set ENABLE_JS on
vishniakov-nikolai Nov 26, 2024
09356ef
Add genai_node_addon component if ENABLE_JS is ON
vishniakov-nikolai Nov 26, 2024
96d53b2
Add wf to check genai js bindings compilation
vishniakov-nikolai Nov 27, 2024
785bf8d
Remove setupvars.sh run
vishniakov-nikolai Nov 27, 2024
e8c53f2
Fix ov + genai workflow
vishniakov-nikolai Nov 27, 2024
82ae75f
Fix ov + genai workflow
vishniakov-nikolai Nov 27, 2024
963fc1d
Fix path to genai folder
vishniakov-nikolai Nov 27, 2024
1d952b6
Change OV branch hash
vishniakov-nikolai Nov 28, 2024
e909f03
Align openvino_tokenizers version with master
vishniakov-nikolai Dec 11, 2024
c5f5f85
Move rpath setting to libopenvino_genai part
vishniakov-nikolai Dec 11, 2024
6d7cbcd
Add ENABLE_JS option to features.cmake
vishniakov-nikolai Dec 11, 2024
d999569
Rollback worflow files
vishniakov-nikolai Dec 11, 2024
4479e1b
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 11, 2024
b722d39
Add genai_nodejs_bindings linux workflow job
vishniakov-nikolai Dec 11, 2024
3b4b3c0
Specify rpath for genai_node_addon.node
vishniakov-nikolai Dec 12, 2024
17f2069
Fix offsets
vishniakov-nikolai Dec 12, 2024
27a97d8
Fix path to js samples in readme
vishniakov-nikolai Dec 12, 2024
b3eba5e
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 12, 2024
6f0e0b4
Align API
vishniakov-nikolai Dec 12, 2024
855c893
Align chat sample
vishniakov-nikolai Dec 12, 2024
df51af9
Add README.md into js chat sample
vishniakov-nikolai Dec 12, 2024
a365ef8
Update build instructions
vishniakov-nikolai Dec 12, 2024
6d0b501
Fix review comments
vishniakov-nikolai Dec 16, 2024
f241cda
Add run js api test in linux workflow
vishniakov-nikolai Dec 16, 2024
1e97e70
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 16, 2024
1f2324b
Fix workflow
vishniakov-nikolai Dec 16, 2024
dda494d
Add test for js sample
vishniakov-nikolai Dec 17, 2024
394d425
Extend linux workflow to run js samples test
vishniakov-nikolai Dec 17, 2024
3186142
Change runner for js samples tests
vishniakov-nikolai Dec 17, 2024
2fbd888
Fix repo path
vishniakov-nikolai Dec 17, 2024
2daa0f3
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 17, 2024
0a0c399
Fix path
vishniakov-nikolai Dec 17, 2024
35c1c61
Add debug output
vishniakov-nikolai Dec 17, 2024
b2cb5dd
Fix js samples test
vishniakov-nikolai Dec 18, 2024
13c0558
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 18, 2024
432e3de
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 23, 2024
30803b4
Fix run sample cmd
vishniakov-nikolai Dec 23, 2024
b04ee6c
Fix js README.md
vishniakov-nikolai Dec 23, 2024
d7e0d2b
Replace AUTO device to CPU
vishniakov-nikolai Dec 23, 2024
d1ce555
Fix js samples README
vishniakov-nikolai Dec 23, 2024
ea0ff4a
Align linux workflow with js samples README
vishniakov-nikolai Dec 23, 2024
7f8ee36
Remove tbb specification from linux js workflow
vishniakov-nikolai Dec 23, 2024
6434daf
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 23, 2024
d03b5cd
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Dec 27, 2024
f9d720b
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 7, 2025
6d36185
Remove extras in README.md
vishniakov-nikolai Jan 7, 2025
2215590
Extend overall status by nodejs samples tests result
vishniakov-nikolai Jan 7, 2025
82881ba
Add more flags for genai nodejs build in linux.yml workflow
vishniakov-nikolai Jan 7, 2025
a1cdda0
Fix linux workflow
vishniakov-nikolai Jan 7, 2025
4a63106
Remove TBB specification
vishniakov-nikolai Jan 7, 2025
02b28ca
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 8, 2025
ea69261
Change compilation instruction in js readme
vishniakov-nikolai Jan 8, 2025
5c00a91
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 8, 2025
e0d444a
Rewrite nodejs bindings part in linux workflow
vishniakov-nikolai Jan 14, 2025
6564fb3
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 15, 2025
bdcd6e2
Rename chat_sample folder to text_generation
vishniakov-nikolai Jan 15, 2025
9ffe6de
Remove extra tests
vishniakov-nikolai Jan 15, 2025
6fb891b
Fix comment
vishniakov-nikolai Jan 15, 2025
2a87a73
Don't use hardcoded version number
vishniakov-nikolai Jan 15, 2025
fc4f8f6
Change install path
vishniakov-nikolai Jan 15, 2025
41e6d41
Add recursive flag to cp
vishniakov-nikolai Jan 15, 2025
6b53381
Fix path to libopenvino.so
vishniakov-nikolai Jan 15, 2025
9dd0ebb
Fix path to genai repo
vishniakov-nikolai Jan 15, 2025
733e858
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 15, 2025
cb02e76
Fix samples dir
vishniakov-nikolai Jan 15, 2025
c57272a
Replace heavy LLM model to light one
vishniakov-nikolai Jan 15, 2025
433d280
Set correct names for steps
vishniakov-nikolai Jan 15, 2025
ad83f13
Fix tests
vishniakov-nikolai Jan 15, 2025
1208f36
Adopt sample test
vishniakov-nikolai Jan 15, 2025
52d6156
Specify RPATH for genai library
vishniakov-nikolai Jan 15, 2025
3e19100
Fix getting version
vishniakov-nikolai Jan 16, 2025
15f44b7
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 16, 2025
c8eee1e
Introduce ENABLE_SAMPLES option
vishniakov-nikolai Jan 16, 2025
11f080c
Remove extra check of ENABLE_SAMPLES
vishniakov-nikolai Jan 16, 2025
3ef358c
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 16, 2025
b941174
Merge branch 'master' into feature/nodejs-bindings
vishniakov-nikolai Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 116 additions & 32 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: aks-linux-2-cores-8gb
container:
image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0'
volumes:
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}

Expand Down Expand Up @@ -114,11 +114,11 @@ jobs:
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${{ env.SRC_DIR}} -B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR}} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose
cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.INSTALL_DIR }}

- name: Pack Artifacts
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/${{ env.GENAI_ARCHIVE_NAME }}
working-directory: ${{ env.INSTALL_DIR }}

- name: Upload Archive Distribution Package
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
Expand All @@ -137,7 +137,7 @@ jobs:
runs-on: aks-linux-4-cores-16gb
container:
image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
volumes:
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
Expand All @@ -161,35 +161,35 @@ jobs:
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
path: ${{ env.OV_INSTALL_DIR }}
merge-multiple: true

- name: Build Tokenizers Wheel
run: |
python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \
--config-settings=override=cross.arch="manylinux_2_31_x86_64" \
${{ needs.openvino_download.outputs.ov_wheel_source }} \
${{ env.SRC_DIR }}/thirdparty/openvino_tokenizers
working-directory: ${{ env.OV_INSTALL_DIR }}

- name: Build GenAI Wheel
run: |
python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} \
--config-settings=override=cross.arch="manylinux_2_31_x86_64" \
${{ needs.openvino_download.outputs.ov_wheel_source }} \
${{ env.SRC_DIR }}
working-directory: ${{ env.OV_INSTALL_DIR }}

- name: Build WWB Wheel
run: python -m pip wheel -v --no-deps --wheel-dir ${{ env.WHEELS_DIR }} ${{ env.SRC_DIR }}/tools/who_what_benchmark
working-directory: ${{ env.OV_INSTALL_DIR }}

- name: Upload Wheels
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: genai_wheels
path: ${{ env.INSTALL_DIR }}
if-no-files-found: 'error'

genai_build_samples:
name: Build Samples - ${{ matrix.build-type }}
strategy:
Expand All @@ -204,7 +204,7 @@ jobs:
runs-on: aks-linux-2-cores-8gb
container:
image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
volumes:
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
Expand All @@ -228,25 +228,25 @@ jobs:
pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_archive_${{ matrix.build-type }}}"
path: ${{ env.OV_INSTALL_DIR }}
merge-multiple: true

- name: Extract Artifacts
run: pigz -dc ${{ env.GENAI_ARCHIVE_NAME }} | tar -xf - -C ${{ env.OV_INSTALL_DIR }}
working-directory: ${{ env.OV_INSTALL_DIR }}

- name: Build Samples (Release)
if: ${{ 'Release' == matrix.build-type }}
run: |
chmod +x ${{ env.OV_INSTALL_DIR }}/samples/cpp/build_samples.sh
${{ env.OV_INSTALL_DIR }}/samples/cpp/build_samples.sh -i ${{ env.INSTALL_DIR }}

- name: Build Samples (${{ matrix.build-type }})
if: ${{ 'Release' != matrix.build-type }}
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ${{ env.OV_INSTALL_DIR }}/samples/cpp/ -B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc)
cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --component samples_bin --prefix ${{ env.INSTALL_DIR }}

- name: Pack Artifacts
run: tar -cvf - * | pigz > ${{ env.INSTALL_DIR }}/${{ env.GENAI_SAMPLES_NAME }}
working-directory: ${{ env.INSTALL_DIR }}
Expand All @@ -258,7 +258,7 @@ jobs:
name: genai_samples_${{ matrix.build-type }}
path: ${{ env.INSTALL_DIR }}/*.tar.gz
if-no-files-found: 'error'

genai_tests_wheel:
name: Python (${{ matrix.test.name}}) Tests (wheel)
needs: [ openvino_download, genai_build_wheel ]
Expand All @@ -277,7 +277,7 @@ jobs:
runs-on: aks-linux-4-cores-16gb
container:
image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
volumes:
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}

Expand All @@ -287,47 +287,47 @@ jobs:
BUILD_DIR: ${{ github.workspace }}/build
TRANSFORMERS_CACHE: ${{ github.workspace }}/models # Hugging Face transformers cache
HF_HOME: ${{ github.workspace }}/datasets # Hugging Face datasets cache

steps:
- name: Clone openvino.genai
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ env.SRC_DIR }}
submodules: recursive

- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_wheels}"
path: ${{ env.INSTALL_DIR }}
merge-multiple: true

- name: Install GenAI Wheels
uses: ./src/.github/actions/install_wheel
with:
packages: "openvino;openvino_tokenizers[transformers];openvino_genai;whowhatbench"
requirements_files: "${{ env.SRC_DIR }}/tests/python_tests/requirements.txt"
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels

- name: Tests
run: python -m pytest -v ./${{ matrix.test.cmd }}
working-directory: ${{ env.SRC_DIR }}

genai_samples_tests:
name: Samples Tests - ${{ matrix.build-type }}
strategy:
fail-fast: false
matrix:
build-type: [Release]
needs: [ openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples ]
needs: [ openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples ]
timeout-minutes: 45
defaults:
run:
shell: bash
runs-on: aks-linux-2-cores-8gb
container:
image: openvinogithubactions.azurecr.io/ov_test/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
volumes:
volumes:
- /mount:/mount
- ${{ github.workspace }}:${{ github.workspace }}

Expand All @@ -336,41 +336,41 @@ jobs:
SRC_DIR: ${{ github.workspace }}/src
BUILD_DIR: ${{ github.workspace }}/build
MODELS_DIR: ${{ github.workspace }}/models

steps:
- name: Clone openvino.genai
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ env.SRC_DIR }}
submodules: recursive

- name: Download Build Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: "{${{ needs.openvino_download.outputs.ov_artifact_name }},genai_archive_${{ matrix.build-type }},genai_samples_${{ matrix.build-type }},genai_wheels}"
path: ${{ env.INSTALL_DIR }}
merge-multiple: true

- name: Extract Artifacts
run: |
pigz -dc ${{ env.GENAI_ARCHIVE_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }}
pigz -dc ${{ env.GENAI_SAMPLES_NAME }} | tar -xf - -C ${{ env.INSTALL_DIR }}
working-directory: ${{ env.INSTALL_DIR }}

- name: Install Wheels
uses: ./src/.github/actions/install_wheel
with:
packages: "openvino;openvino_tokenizers[transformers];openvino_genai"
requirements_files: "${{ env.SRC_DIR }}/samples/requirements.txt"
local_wheel_dir: ${{ env.INSTALL_DIR }}/wheels

- name: Download & convert Models and data
run: |
mkdir -p ${{ env.MODELS_DIR }}
optimum-cli export openvino --trust-remote-code --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 ${{ env.MODELS_DIR }}/TinyLlama-1.1B-Chat-v1.0
optimum-cli export openvino --trust-remote-code --model openai/whisper-tiny ${{ env.MODELS_DIR }}/whisper-tiny
wget https://storage.openvinotoolkit.org/models_contrib/speech/2021.2/librispeech_s5/how_are_you_doing_today.wav -O ${{ env.MODELS_DIR }}/how_are_you_doing_today.wav

- name: Test multinomial_causal_lm.py
if: ${{ 'Release' == matrix.build-type }} # Python bindings can be built in Release only
timeout-minutes: 1
Expand All @@ -382,10 +382,10 @@ jobs:
timeout-minutes: 1
run: ${{ env.INSTALL_DIR }}/samples/python/whisper_speech_recognition/whisper_speech_recognition.py ./whisper-tiny/ how_are_you_doing_today.wav
working-directory: ${{ env.MODELS_DIR }}

- name: C++ Tests Prerequisites
run: python -m pip uninstall openvino openvino-tokenizers openvino-genai -y

- name: Test greedy_causal_lm
run: |
source ${{ env.INSTALL_DIR }}/setupvars.sh
Expand All @@ -398,9 +398,93 @@ jobs:
${{ env.INSTALL_DIR }}/samples_bin/whisper_speech_recognition ./whisper-tiny/ how_are_you_doing_today.wav
working-directory: ${{ env.MODELS_DIR }}

genai_build_nodejs_bindings:
name: Build Node.js bindings
strategy:
fail-fast: false
vishniakov-nikolai marked this conversation as resolved.
Show resolved Hide resolved
matrix:
build-type: [Release]
needs: [ openvino_download ]
timeout-minutes: 20
defaults:
run:
shell: bash
runs-on: aks-linux-4-cores-16gb
container:
image: openvinogithubactions.azurecr.io/ov_build/ubuntu_22_04_x64:${{ needs.openvino_download.outputs.docker_tag }}
volumes:
- /mount:/mount
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING -v ${{ github.workspace }}:${{ github.workspace }}
vishniakov-nikolai marked this conversation as resolved.
Show resolved Hide resolved
env:
CMAKE_GENERATOR: Unix Makefiles
OV_INSTALL_DIR: ${{ github.workspace }}/ov
BUILD_DIR: ${{ github.workspace }}/build
SRC_DIR: ${{ github.workspace }}/src

steps:
- name: Clone openvino.genai
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: ${{ env.SRC_DIR }}
submodules: recursive

- name: Download OpenVINO package
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
path: ${{ env.OV_INSTALL_DIR }}
merge-multiple: true

- name: Build with ENABLE_JS=ON
run: |
source ${{ env.OV_INSTALL_DIR }}/setupvars.sh
cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DENABLE_JS=ON -S ${{ env.SRC_DIR }} -B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --parallel $(nproc) --verbose
cmake --install ${{ env.BUILD_DIR }} --config ${{ matrix.build-type }} --prefix ${{ env.OV_INSTALL_DIR }}

- name: Combine binaries for Node.js package
run: |
mkdir -p nodejs
cp -r runtime/lib/intel64/* nodejs
cp -r runtime/3rdparty/tbb/lib/* nodejs
cp genai_node_addon.node nodejs
GENAI_VERSION=$(grep -oP '(?<=CMAKE_PROJECT_VERSION:STATIC=)[^"]*' ${{ env.BUILD_DIR }}/CMakeCache.txt)
OV_VERSION=$(echo $GENAI_VERSION | sed 's/..$//')
patchelf --set-rpath '$ORIGIN' nodejs/libopenvino.so.$OV_VERSION nodejs/libopenvino_genai.so.$GENAI_VERSION
working-directory: ${{ env.OV_INSTALL_DIR }}

- name: Pack Node.js bindings libs
run: tar -cvf - * | pigz > ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
working-directory: ${{ env.OV_INSTALL_DIR }}/nodejs

- name: Upload Archive Package with Node.js bindings
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: genai_nodejs_bindings
path: ${{ env.BUILD_DIR }}/genai_nodejs_bindings.tar.gz
if-no-files-found: 'error'

- name: Run npm package tests
working-directory: ${{ env.SRC_DIR }}/src/js
run: |
cp -R ${{ env.OV_INSTALL_DIR }}/nodejs bin
npm install
npm test

- name: Install genai-node samples dependencies
run: npm install
working-directory: ${{ env.SRC_DIR }}/samples/js/text_generation

- name: Run samples tests
run: npm test
env:
MODEL_PATH: ${{ env.SRC_DIR }}/src/js/tests/models/Llama-3.1-8B-Instruct-FastDraft-150M-int8-ov
working-directory: ${{ env.SRC_DIR }}/samples/js/text_generation

Overall_Status:
name: ci/gha_overall_status_linux
needs: [openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples, genai_tests_wheel, genai_samples_tests]
needs: [openvino_download, genai_build_cmake, genai_build_wheel, genai_build_samples, genai_tests_wheel, genai_samples_tests, genai_build_nodejs_bindings]
vishniakov-nikolai marked this conversation as resolved.
Show resolved Hide resolved
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ if(NOT DEFINED Python3_FIND_VIRTUALENV)
set(Python3_FIND_VIRTUALENV FIRST)
endif()

# Disable building samples for NPM package
if(CPACK_GENERATOR STREQUAL "NPM")
set(ENABLE_SAMPLES OFF)
endif()
ilya-lavrenov marked this conversation as resolved.
Show resolved Hide resolved

# Looking for OpenVINO in the python distribution. It doesn't work for cross-compiling build
if(NOT CMAKE_CROSSCOMPILING)
find_package(Python3 REQUIRED)
Expand Down Expand Up @@ -88,7 +93,7 @@ endif()

add_subdirectory(thirdparty)
add_subdirectory(src)
if(EXISTS "${OpenVINOGenAI_SOURCE_DIR}/samples")
if(EXISTS "${OpenVINOGenAI_SOURCE_DIR}/samples" AND ENABLE_SAMPLES)
add_subdirectory(samples)
endif()
if(EXISTS "${OpenVINOGenAI_SOURCE_DIR}/tools/continuous_batching")
Expand All @@ -109,6 +114,9 @@ set(CPACK_COMPONENTS_ALL core_genai core_genai_dev cpp_samples_genai licensing_g
if(ENABLE_PYTHON)
list(APPEND CPACK_COMPONENTS_ALL pygenai_${Python3_VERSION_MAJOR}_${Python3_VERSION_MINOR})
endif()
if(ENABLE_JS)
list(APPEND CPACK_COMPONENTS_ALL genai_node_addon)
Wovchena marked this conversation as resolved.
Show resolved Hide resolved
endif()
if(WIN32 AND NOT DEFINED CPACK_GENERATOR)
set(CPACK_GENERATOR "ZIP")
endif()
Expand Down
2 changes: 2 additions & 0 deletions cmake/features.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
#

option(ENABLE_PYTHON "Enable Python API build" ON)
option(ENABLE_JS "Enable JS API build" OFF)
option(ENABLE_SAMPLES "Enable samples build" ON)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ find_python3 = true
build_args = ["--parallel", "--target", "py_openvino_genai_stub"]
install_args = ["--strip"]
install_components = ["wheel_genai"]
options = {"BUILD_TOKENIZERS" = "OFF"}
options = {"BUILD_TOKENIZERS" = "OFF", "ENABLE_SAMPLES" = "OFF"}

[build-system]
requires = [
Expand Down
4 changes: 4 additions & 0 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# SPDX-License-Identifier: Apache-2.0
#

if(NOT ENABLE_SAMPLES)
return()
ilya-lavrenov marked this conversation as resolved.
Show resolved Hide resolved
ilya-lavrenov marked this conversation as resolved.
Show resolved Hide resolved
endif()

add_subdirectory(cpp/text_generation)
add_subdirectory(cpp/image_generation)
add_subdirectory(cpp/visual_language_chat)
Expand Down
1 change: 1 addition & 0 deletions samples/js/text_generation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Loading
Loading