-
Notifications
You must be signed in to change notification settings - Fork 165
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
Add extension near to genai library #461
Closed
Wovchena
wants to merge
239
commits into
openvinotoolkit:master
from
Wovchena:add-extension-near-to-genai-library
Closed
Changes from 229 commits
Commits
Show all changes
239 commits
Select commit
Hold shift + click to select a range
ba91fde
initial generate
pavel-esir 9d85a0e
LLM pipeline
pavel-esir b21c6c1
Added calculating for several batches
pavel-esir e52e90d
Greedy search works
pavel-esir 745a804
rename to GenerationConfig
pavel-esir 8895ed0
Add fluent interface
pavel-esir b24977d
Update text_generation/causal_lm/cpp/generate_pipeline/generate_pipel…
pavel-esir c933ca0
cosmetic changes in main
pavel-esir c43e901
greedy search with batches and left padding works
pavel-esir 5a914f6
combine LLModel with LLMPipeline
pavel-esir c1e0c9d
wip: enable calling tokenize/detokenize for LLMPipeline
pavel-esir 8d66353
add callback to generate
pavel-esir fa12da7
cleanup generate_sample.cpp
pavel-esir 5ceb9d5
add speculative decoding
pavel-esir a5083c7
separate Tokenizer
pavel-esir 7692160
wip
pavel-esir d3f6339
add start/stop conversation
pavel-esir 3776433
use text in streamer instead of raw tokens
pavel-esir 964a5e8
add apply_chat_template
pavel-esir e57aa4c
fix difference between accumulating conversation as text and keeping …
pavel-esir d0c1341
cleanup
pavel-esir 8dcea1f
add Jinja2cpp submodule
pavel-esir 754a462
add ov namespace
pavel-esir 9b19c6f
return scores for batched outputs
pavel-esir 9bf6caa
add AnyMap
pavel-esir 39fd73c
Merge remote-tracking branch 'upstream/master' into generate_pipeline
pavel-esir 63d8f6d
cleanup
pavel-esir a833760
before moving to pimpl
pavel-esir 1681654
move to separate include & src
pavel-esir 9fe73c6
pimpl implementation
pavel-esir 053708f
temporary disable jinja2cpp
pavel-esir bd6849a
add python api draft, hide implementations from user & refactor imple…
pavel-esir 62c471e
extract decoding methods to separate files
pavel-esir f1d54f4
extended python api, added python api test
pavel-esir 3c82e11
remove call method
pavel-esir 5543cee
init
Wovchena abb8835
add_subdirectory
Wovchena 0998abc
add files
Wovchena 15492c4
add __init__.py
Wovchena 005d3fb
removed set_streamer
pavel-esir cc44bc8
use std::optional
pavel-esir d8cab05
started to add Readme docs
pavel-esir 2535394
reoder Readme
pavel-esir 95c1bfb
rm generate_pipeline/python
Wovchena 4510f71
update Readme; cleanup LLMPipeline and add docstring
pavel-esir 507bc49
refactor folder structure
pavel-esir af747d4
cleanup generation_config and ov::Tokenizer
pavel-esir c6620d9
move includes to a separate openvino/genai folder
pavel-esir 59c3e0b
Merge branch 'generate_pipeline' into package
Wovchena be84345
align names
Wovchena bced64a
Dont modify text_generation/causal_lm/cpp/CMakeLists.txt
Wovchena f4e82b6
rm -r text_generation/causal_lm/cpp/generate_pipeline/python-bindings/
Wovchena 5b2b0ca
fix build
Wovchena 0dd8f59
add tokenizers only once
Wovchena 23638ff
change cmake.source-dir
Wovchena d8c5349
restore openvino/genai inits
Wovchena 24faefe
Integrate JinjaCpp
ilya-lavrenov 598dda3
install genai lib
Wovchena f274b93
Merge pull request #2 from ilya-lavrenov/jinja-integration-pavel
pavel-esir 02d0eae
import openvino for win and lin
Wovchena e6695f3
Merge branch 'generate_pipeline' into package
Wovchena a27c5a7
put the line back
Wovchena 0849c41
Added cmake build type before project clause
ilya-lavrenov 34cddff
one line properties
Wovchena 023cf1e
Merge pull request #3 from ilya-lavrenov/cmake-build-type
pavel-esir 6a5d750
Export API symbols
ilya-lavrenov 27f385e
Merge pull request #4 from ilya-lavrenov/generate_pipeline
pavel-esir a9332f0
Merge branch 'generate_pipeline' into package
Wovchena 9ef488c
rename
Wovchena 4fad7d5
add .github/workflows/genai_lib.yml
Wovchena 51e03a2
on: pull_request
Wovchena e23a7bb
spelling
Wovchena fc5b753
install openvino
Wovchena 09f8806
add syntacis sugar for geenrate, optimize value passing by reference
pavel-esir af22a8a
remove speculative decoding
pavel-esir e7db7e8
update
Wovchena f279363
add rpath
Wovchena 83d77c8
add rpath to libopenvino.so
Wovchena 167f924
py_generate_pipeline
Wovchena a111a3f
reorder tokenizer.cpp, add comments to BaseStreamer
pavel-esir 813d80a
install centos7
Wovchena 6227b65
install nightly
Wovchena 74fc107
Merge branch 'generate_pipeline' into package
Wovchena 9b83a7e
propagate _GLIBCXX_USE_CXX11_ABI
Wovchena 2d15752
Populate python with the libraries to allow skipping wheel installation
Wovchena 8025554
run setupvars
Wovchena 2b14286
update .gitignore, install numpy
Wovchena 1c11bc7
quotes
Wovchena e7fce82
fix PYTHONPATH
Wovchena 64608d1
fix PYTHONPATH
Wovchena 43b87c7
quotes
Wovchena fef9674
reorder vars
Wovchena b21286c
openvino.genai-
Wovchena d393f89
Merge pull request #1 from Wovchena/package
pavel-esir 2b8954d
Merge branch 'master' into generate_pipeline
pavel-esir 11e872b
Update CMakeLists.txt
pavel-esir 442dcbf
move group beam searcher to src
pavel-esir 53d534e
Update .gitignore (#5)
Wovchena dcb4b86
Merge remote-tracking branch 'origin/generate_pipeline' into generate…
pavel-esir 72c045e
fixed difference between old greddy sample and generate
pavel-esir 11fbaa2
tokenizer minor fixes
pavel-esir 264e99f
apply comments
pavel-esir 11032b4
remove accidentally added test_cpp_samples.py
pavel-esir 7d0c80b
fix build
pavel-esir 2e3cd73
fix causal_lm comparison error
pavel-esir e7fa974
fix different outputs
pavel-esir 78d0b88
Archive (#7)
Wovchena 5eb59ea
add tests
pavel-esir ce4eb00
Apply suggestions from code review
pavel-esir aa90e9d
names correction
pavel-esir d843229
enable
Wovchena 2c1d1ef
libtbb-dev
Wovchena 57ca2d4
move
Wovchena 37844c9
slash
Wovchena 5cff21e
install
Wovchena 561b55a
core_genai_dev
Wovchena 260d913
remove export
Wovchena 54cbb52
update URL_HASH
Wovchena 82a9449
remove submodules from .gitmodules
Wovchena 5a0079b
install openvino_tokenizers for genai_python_lib
pavel-esir 73e4312
Update Jinja2Cpp fork commit
Wovchena 75b7c37
remove group_beam_searcher.hpp; copy fast_tokenizer
pavel-esir b6cf954
rreorganaise components
Wovchena aaf5c78
add SOVERSION, and requirements-build.txt
Wovchena 5537d3b
repalce SKBUILD with EXCLUDE_FROM_ALL because the effect is the same
Wovchena 9966be4
fix NAMELINK_COMPONENT
Wovchena 2486e53
remove extraline
Wovchena 7953c0f
Merge branch 'generate_pipeline' into fix-archive
Wovchena 786eac7
add soft restrictions
Wovchena 7324da9
Fix build to unblock packaging
Wovchena 5577e84
improve naming
Wovchena b679fc7
install samples
Wovchena 26f9fe1
remove quotes
Wovchena 1dcd40b
use main target name because an alias can't be specified in cmake --t…
Wovchena 8c00ccb
define CMAKE_BUILD_PARALLEL_LEVEL
Wovchena 61fba58
Ensure ./requirements-build.txt won't outdate
Wovchena d78fa3b
Use ./requirements-build.txt in python lib build
Wovchena 757b738
Add missing &&
Wovchena 51ace23
Test Debug
Wovchena e53c525
add matrix for windows_genai_package
Wovchena 73ac7b1
openvino_tokenizers from form
Wovchena e7e50cb
update openvino_tokenizers
Wovchena 3339407
update openvino_tokenizers
Wovchena 9b5b915
update openvino_tokenizers
Wovchena 1fe85b9
revert openvino_tokenizers
Wovchena 7e23930
tokenizers from fork
Wovchena 62f5e34
update tokenizers
Wovchena 63262d7
centos7_2024.2.0.dev
Wovchena 2d5fc6f
copy target
Wovchena 6f53005
revert tokenizers
Wovchena d8e5bf9
reapply useful changes
Wovchena 9866f5c
copy so only
Wovchena 2c691c3
Update tokenizers, centos7_2024.2.0.dev
Wovchena 3507deb
single thread
Wovchena 70f1177
Fix archive (#8)
Wovchena da729ba
Apply suggestions from code review
pavel-esir 28c313b
add groups to GenerationConfig docstring
pavel-esir c395a8d
refactor namespace ov::* -> ov::genai::*
pavel-esir bbc8c25
removed ov_tokenizers_path when ov::gena::Tokenizer is passed to LLMP…
pavel-esir 18f8ca8
ubuntu22
Wovchena 3e914c5
nightyl
Wovchena ad49d94
--pre --extra-index-url
Wovchena 963a520
update tokenizers
Wovchena 72bede7
space
Wovchena e8f4cbe
move --pre --extra-index-url https://storage.openvinotoolkit.org/simp…
Wovchena 5afd763
release tokenizers
Wovchena b47d6d5
merge
Wovchena 7a28144
downgrade tokenizers
Wovchena b7493a1
downgrade
Wovchena ee97729
two steps
Wovchena 0a5d765
downgrade tokenizers
Wovchena f4e444f
dont setupvars
Wovchena 8bcf504
source
Wovchena f457faf
fix
Wovchena 7a2986a
submodule
Wovchena 25ea88c
releases/2024/2 tokenizers
Wovchena 2f88d0a
fix-2
Wovchena 829b40e
rebase
Wovchena 3a7db44
use make
Wovchena b5e5800
comment
Wovchena 72a041c
CMAKE_GENERATOR=Unix Makefiles
Wovchena 6116bd1
update openvino
Wovchena 959f0c2
space
Wovchena 312e0ae
optimum-cli from fork
Wovchena 0286c96
different commit
Wovchena 78666da
from branch
Wovchena 140b59c
Merge branch 'generate_pipeline' into fix-abi
Wovchena a413be8
remove exrtra-index for SD
Wovchena de3a17e
reorder pip install
Wovchena 4adaa33
revert unwanted changes
Wovchena 0d7f893
Ubuntu-22
Wovchena 9e37273
Add sampling decoding (#6)
as-suvorov 82a7823
openvino_tokenizers~=2024.2.0.0
Wovchena 323e7ac
remove -pre . --extra-index-url https://storage.openvinotoolkit.org/s…
Wovchena 95e5a01
upgrade to prerelease
Wovchena 4f22d86
revert requirements.txt
Wovchena d94ba2e
remove --pre, setupvars
Wovchena 501cb8b
get openvino_tokenizers._ext_path
Wovchena 336036a
take release pybind, fix soversion, and tokenizers folder
Wovchena 3fd374f
spelling
Wovchena 2eaf369
dont copy libs
Wovchena 07e2385
put ov_tokenizers_path back
Wovchena 7a79f8d
GENAI_BUILD_DIR=../../build
Wovchena 2705867
Add extension near to genai library
Wovchena ce79a0e
include openvino/util/file_util.hpp
Wovchena f4d6c1f
get_absolute_file_path
Wovchena d99aca1
remove namepsace
Wovchena e375901
# include <limits.h>
Wovchena f9d9b18
more than one .
Wovchena 2ac081c
till next dot
Wovchena 0e18c9c
_ext_path
Wovchena 4c10755
-1
Wovchena 38076fc
+1
Wovchena d9edf2d
+1
Wovchena 8c44fdd
path
Wovchena 3030852
ext name
Wovchena dc885bb
with_openvino_tokenizers
Wovchena 6856b5e
char
Wovchena 5b5fd01
revert test
Wovchena 014e9ee
tokenizers from form
Wovchena adc1f72
update fork
Wovchena 4b806c0
lib
Wovchena cb81756
fix cherry-pick
Wovchena 0110e51
update fork
Wovchena c97f2f8
dont spoil source dir
Wovchena 934e438
Generator expressions to disable appending a per-configuration subdir…
Wovchena c976ff8
remove versions
Wovchena 9483cb6
fix path
Wovchena ebad130
try
Wovchena 38cbffd
try
Wovchena dc80b54
verbose
Wovchena 25059f0
spelling
Wovchena 3c5e130
rename file
Wovchena 60cb221
remove build.tool-args
Wovchena c52dc22
Release
Wovchena 9ef686a
dont speciify targets
Wovchena 81ec069
Fix library loading by updating dependencies (#10)
Wovchena 13ad3d2
Merge branch 'generate_pipeline' into add-extension-near-to-genai-lib…
Wovchena 24e0e41
revert 81ec069
Wovchena File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: genai_package | ||
on: pull_request | ||
jobs: | ||
ubuntu_genai_package: | ||
strategy: | ||
matrix: | ||
build-type: [Release, Debug] | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- run: mkdir ./ov/ | ||
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/linux/l_openvino_toolkit_ubuntu20_2024.2.0.dev20240524_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz | ||
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh | ||
- run: sudo apt-get install libtbb-dev | ||
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ | ||
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j | ||
- run: source ./ov/setupvars.sh && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix ov | ||
- run: ov/samples/cpp/build_samples.sh -i ${{ github.workspace }}/s\ pace | ||
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build | ||
- run: source ./ov/setupvars.sh && python -m pip install --upgrade-strategy eager -r text_generation/causal_lm/cpp/requirements.txt | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: source ./ov/setupvars.sh && optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: source ./ov/setupvars.sh && timeout 50s ${{ github.workspace }}/s\ pace/samples_bin/greedy_causal_lm ./TinyLlama-1.1B-Chat-v1.0/ "" | ||
if: ${{ 'Release' == matrix.build-type }} | ||
|
||
windows_genai_package: | ||
strategy: | ||
matrix: | ||
build-type: [Release, Debug] | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: cmd | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- run: curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/windows/w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64.zip | ||
- run: unzip ov.zip | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -S ./ -B ./build/ | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake --build ./build/ --config ${{ matrix.build-type }} --target package -j | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake --install ./build/ --config ${{ matrix.build-type }} --prefix w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64 | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\samples\cpp\build_samples_msvc.bat -i "${{ github.workspace }}/samples_install" | ||
if: ${{ 'Release' == matrix.build-type }} # build_samples enforces Release build | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install --upgrade-strategy eager -r text_generation/causal_lm/cpp/requirements.txt | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && optimum-cli export openvino --trust-remote-code --weight-format fp16 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 TinyLlama-1.1B-Chat-v1.0 | ||
if: ${{ 'Release' == matrix.build-type }} | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && "${{ github.workspace }}/samples_install/samples_bin/greedy_causal_lm" .\TinyLlama-1.1B-Chat-v1.0\ "" | ||
if: ${{ 'Release' == matrix.build-type }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: genai_python_lib | ||
on: pull_request | ||
jobs: | ||
ubuntu_genai_python_lib: | ||
# A tokenizers' dependency fails to compile on ubuntu-20 n CenOS7 env | ||
runs-on: ubuntu-22.04 | ||
env: | ||
# A tokenizers' dependency fails to compile with Ninja in CenOS7 env | ||
CMAKE_GENERATOR: Unix Makefiles | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- run: mkdir ./ov/ | ||
- run: curl https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/linux/l_openvino_toolkit_centos7_2024.2.0.dev20240524_x86_64.tgz | tar --directory ./ov/ --strip-components 1 -xz # Install CentOS7 instead of Ubuntu to match PyPI distribution ABI | ||
- run: sudo ./ov/install_dependencies/install_openvino_dependencies.sh | ||
- run: source ./ov/setupvars.sh && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ | ||
- run: source ./ov/setupvars.sh && cmake --build ./build/ --config Release -j | ||
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal | ||
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts. | ||
- run: source ./ov/setupvars.sh && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | ||
- run: source ./ov/setupvars.sh && PYTHONPATH=./build/ python -c "from openvino_genai import LLMPipeline" | ||
- run: source ./ov/setupvars.sh && CMAKE_BUILD_PARALLEL_LEVEL="" python -m pip install . | ||
- run: python -c "from openvino_genai import LLMPipeline" | ||
- name: GenAI Python API tests | ||
run: | | ||
cd ./tests/python_tests/ | ||
python -m pip install -r requirements.txt | ||
models=$(python list_test_models.py) | ||
echo "$models" | while read -r model_name model_path; do | ||
optimum-cli export openvino --trust-remote-code --weight-format fp16 --model "$model_name" "$model_path" | ||
done | ||
python -m pytest test_generate_api.py | ||
|
||
windows_genai_python_lib: | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: cmd | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
- run: curl --output ov.zip https://storage.openvinotoolkit.org/repositories/openvino/packages/pre-release/2024.2.0rc1/windows/w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64.zip | ||
- run: unzip ov.zip | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake -DCMAKE_BUILD_TYPE=Release -S ./ -B ./build/ | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && cmake --build ./build/ --config Release -j | ||
# GitHub Actions already provides what is listed in ./requirements-build.txt but the internal | ||
# build system doesn't. Install ./requirements-build.txt to detect possible conflicts. | ||
- run: call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install ./thirdparty/openvino_tokenizers/[transformers] -r ./requirements-build.txt --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release | ||
- run: set "PYTHONPATH=./build/" && call w_openvino_toolkit_windows_2024.2.0.dev20240524_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: set CMAKE_BUILD_PARALLEL_LEVEL=&& call w_openvino_toolkit_windows_2024.2.0.dev20240524_x86_64\setupvars.bat && python -m pip install . | ||
- run: python -c "from openvino_genai import LLMPipeline" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.15) | ||
|
||
# Multi config generators such as Visual Studio ignore CMAKE_BUILD_TYPE. Multi config generators are configured with | ||
# CMAKE_CONFIGURATION_TYPES, but limiting options in it completely removes such build options | ||
get_property(GENERATOR_IS_MULTI_CONFIG_VAR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) | ||
if(NOT GENERATOR_IS_MULTI_CONFIG_VAR AND NOT DEFINED CMAKE_BUILD_TYPE) | ||
message(STATUS "CMAKE_BUILD_TYPE is not defined, 'Release' will be used") | ||
# Setting CMAKE_BUILD_TYPE as CACHE must go before project(). Otherwise project() sets its value and set() doesn't take an effect | ||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...") | ||
endif() | ||
|
||
project(OpenVINOGenAI VERSION 2024.2.0.0) | ||
|
||
add_subdirectory(./thirdparty/openvino_tokenizers/ "${CMAKE_CURRENT_BINARY_DIR}/openvino_tokenizers/") | ||
# Put binaries to a single dir to mimic package structure. | ||
set_target_properties(openvino_tokenizers PROPERTIES | ||
# Generator expressions to disable appending a per-configuration subdirectory (Release, Debug). | ||
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>" | ||
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>" | ||
) | ||
if(TARGET core_tokenizers) | ||
set_target_properties(core_tokenizers PROPERTIES | ||
LIBRARY_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>" | ||
RUNTIME_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR}/openvino_genai/>" | ||
) | ||
else() | ||
# Prebuilt dependencies | ||
if(WIN32) | ||
set(extra_libs "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/lib/core_tokenizers.dll" | ||
"${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/third_party/lib/icudt70.dll" | ||
"${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/third_party/lib/icuuc70.dll") | ||
elseif(LINUX) | ||
set(extra_libs "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/lib/libcore_tokenizers.so") | ||
elseif(APPLE) | ||
set(extra_libs "${CMAKE_BINARY_DIR}/_deps/fast_tokenizer-src/lib/libcore_tokenizers.dylib") | ||
endif() | ||
add_custom_command(OUTPUT "${extra_libs}" | ||
COMMAND "${CMAKE_COMMAND}" -E copy "${extra_libs}" "${CMAKE_BINARY_DIR}/openvino_genai/" | ||
DEPENDS openvino_tokenizers) | ||
endif() | ||
add_subdirectory(src) | ||
add_subdirectory(text_generation/causal_lm/cpp) | ||
|
||
install(DIRECTORY text_generation/causal_lm/cpp/ DESTINATION samples/cpp/causal_lm COMPONENT cpp_samples_genai) | ||
install(FILES LICENSE DESTINATION licensing COMPONENT licensing_genai RENAME LICENSE-GENAI) | ||
install(FILES third-party-programs.txt DESTINATION licensing COMPONENT licensing_genai RENAME third-party-programs-genai.txt) | ||
set(CPACK_GENERATOR "ZIP") | ||
include(CPack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[project] | ||
name = "openvino_genai" | ||
version = "2024.2.0.0" | ||
description = "Python bindings for https://github.com/openvinotoolkit/openvino.genai" | ||
requires-python = ">=3.8" | ||
readme = {file = "text_generation/causal_lm/cpp/README.md", content-type="text/markdown"} | ||
license = {text = "OSI Approved :: Apache Software License"} | ||
authors = [ | ||
{ name = "OpenVINO Developers", email = "openvino@intel.com" }, | ||
] | ||
classifiers = [ | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
dependencies = [ | ||
"openvino_tokenizers~=2024.2.0.0" | ||
] | ||
|
||
[tool.scikit-build] | ||
cmake.source-dir = "./" | ||
cmake.build-type = "Release" | ||
cmake.targets = ["py_generate_pipeline", "genai"] | ||
install.components = ["wheel_genai"] | ||
sdist.cmake = true | ||
wheel.packages = ["src/python/openvino_genai"] | ||
wheel.install-dir = "openvino_genai" | ||
wheel.build-tag = "000" | ||
wheel.license-files = ["LICENSE", "SECURITY.md", "third-party-programs.txt"] | ||
|
||
[[tool.scikit-build.generate]] | ||
path = "openvino_genai/__version__.py" | ||
template = ''' | ||
__version__ = "${version}" | ||
''' | ||
|
||
[build-system] | ||
requires = ["scikit-build-core~=0.8.0", "cmake~=3.23"] # See https://github.com/openvinotoolkit/openvino_tokenizers/pull/123 | ||
build-backend = "scikit_build_core.build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build~=1.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright (C) 2018-2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# Find OpenVINODeveloperPackage first to compile with SDL flags | ||
find_package(OpenVINODeveloperPackage QUIET | ||
PATHS "${OpenVINO_DIR}") | ||
if(NOT OpenVINODeveloperPackage_FOUND) | ||
find_package(OpenVINO REQUIRED COMPONENTS Runtime) | ||
endif() | ||
|
||
add_subdirectory(cpp) | ||
add_subdirectory(python) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to see logs, maybe they will help