diff --git a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/_custom_build.py b/modules/custom_operations/user_ie_extensions/src/tokenizer/python/_custom_build.py deleted file mode 100644 index abdfa78f8..000000000 --- a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/_custom_build.py +++ /dev/null @@ -1,77 +0,0 @@ -from setuptools.command.build_py import build_py as _build_py -import os.path -import sys -import multiprocessing -from pathlib import Path - -PYTHON_VERSION = f"python{sys.version_info.major}.{sys.version_info.minor}" - -# The following variables can be defined in environment or .env file -SCRIPT_DIR = Path(__file__).resolve().parents[0] -WORKING_DIR = Path.cwd() -BUILD_BASE = f"{WORKING_DIR}/build_{PYTHON_VERSION}" -OPENVINO_BUILD_DIR = os.getenv("OPENVINO_BUILD_DIR") -CONFIG = os.getenv("BUILD_TYPE", "Release") - -class build_py(_build_py): - def run(self): - self.cmake_build() - # self.run_command("build_ext") - return super().run() - - def initialize_options(self): - """Set default values for all the options that this command supports.""" - super().initialize_options() - self.build_base = BUILD_BASE - self.jobs = None - self.cmake_args = None - - def finalize_options(self): - """Set final values for all the options that this command supports.""" - super().finalize_options() - - if self.jobs is None and os.getenv("MAX_JOBS") is not None: - self.jobs = os.getenv("MAX_JOBS") - self.jobs = multiprocessing.cpu_count() if self.jobs is None else int(self.jobs) - - if self.cmake_args is None: - self.cmake_args = "" - - def cmake_build(self): - """Runs cmake (configure, build) if artfiacts are not already built""" - self.build_temp = os.path.join(self.build_base, "temp") - self.announce(f"Create build directory: {self.build_temp}", level=3) - - source_dir = '/home/rmikhail/src/openvino_contrib/modules/custom_operations/user_ie_extensions' - binary_dir = '/home/rmikhail/src/openvino_contrib/modules/custom_operations/user_ie_extensions/tokenizer/python/ov_tokenizer/build' - - # even perform a build in case of binary directory does not exist - binary_dir = binary_dir if os.path.isabs(binary_dir) else os.path.join(self.build_temp, binary_dir) - if not os.path.exists(binary_dir): - binary_dir = os.path.join(self.build_temp, binary_dir) - self.announce(f"Configuring cmake project", level=3) - self.spawn(["cmake", f"-DOpenVINO_DIR={OPENVINO_BUILD_DIR}", - f"-DCMAKE_BUILD_TYPE={CONFIG}", - '-DCUSTOM_OPERATIONS=tokenizer', - self.cmake_args, - "-S", source_dir, - "-B", binary_dir]) - - self.announce(f"Building project", level=3) - self.spawn(["cmake", "--build", binary_dir, - "--config", CONFIG, - "--parallel", str(self.jobs)]) - - # def initialize_options(self): - # super().initialize_options() - # if self.distribution.ext_modules == None: - # self.distribution.ext_modules = [] - - # self.distribution.ext_modules.append( - - # Extension( - # "bs", - # sources=["black_scholes/bs.c"], - # extra_compile_args=["-std=c17", "-lm", "-Wl", "-c", "-fPIC"], - # ) - # ) \ No newline at end of file diff --git a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/pyproject.toml_1 b/modules/custom_operations/user_ie_extensions/src/tokenizer/python/pyproject.toml_1 deleted file mode 100644 index 39c5042cc..000000000 --- a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/pyproject.toml_1 +++ /dev/null @@ -1,68 +0,0 @@ -[project] -name = "ov_tokenizer" -version = "0.0.1" -description = "Convert tokenizers into OpenVINO models" -requires-python = ">=3.8" -authors = [ - { name = "OpenVINO Developers", email = "openvino@intel.com" }, -] - -dependencies = [ - "openvino", - "numpy" -] - -[project.optional-dependencies] -dev = [ - "ruff", - "pytest", -] -transformers = [ - "transformers[sentencepiece,tiktoken]" -] -tiktoken = [ - "tiktoken" -] -all = [ - "ov_tokenizer[dev,transformers,tiktoken]" -] - -[tool.ruff] -ignore = ["C901", "E501", "E741", "W605"] -select = ["C", "E", "F", "I", "W"] -line-length = 119 - -[tool.ruff.per-file-ignores] -"__init__.py" = ["F401"] -"ov_tokenizer/hf_parser.py" = ["F821"] - -[tool.ruff.isort] -lines-after-imports = 2 - -[build-system] -requires = [ - "setuptools>=42", - "scikit-build", - "cmake>=3.14", - "ninja", - "pybind11>=2.6" -] -build-backend = "setuptools.build_meta" - -#[tool.setuptools] -#py-modules = ["_custom_build"] - -#[tool.setuptools.cmdclass] -#build_py = "_custom_build.build_py" - -#[build-system] -#requires = ["setuptools>=61.0"] -#build-backend = "setuptools.build_meta" - -#[build-system] -#requires = ["hatchling"] -#build-backend = "hatchling.build" - -#[build-system] -#requires = ["pdm-backend"] -#build-backend = "pdm.backend" \ No newline at end of file diff --git a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/setup.py_1 b/modules/custom_operations/user_ie_extensions/src/tokenizer/python/setup.py_1 deleted file mode 100644 index 17ae7f8c2..000000000 --- a/modules/custom_operations/user_ie_extensions/src/tokenizer/python/setup.py_1 +++ /dev/null @@ -1,15 +0,0 @@ -from skbuild import setup - -setup( - name="hello-cmake-package", - version="0.1.0", - # packages=["ov_tokenizer"], - package_dir={"": "ov_tokenizer"}, - cmake_install_dir="src/lib", - cmake_source_dir="./../../../user_ie_extensions" -) - -# When building extension modules `cmake_install_dir` should always be set to the -# location of the package you are building extension modules for. -# Specifying the installation directory in the CMakeLists subtley breaks the relative -# paths in the helloTargets.cmake file to all of the library components. \ No newline at end of file