-
Notifications
You must be signed in to change notification settings - Fork 11
standartize pyproject & speedup tests #176
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
Conversation
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.
Pull Request Overview
This PR aims to speed up tests by updating the configuration and workflows to leverage parallel execution and retries for flaky tests. Key changes include:
- Adding the pytest-rerunfailures dependency and modifying pytest options in pyproject.toml.
- Refactoring multiple GitHub workflow files to use a reusable workflow for running tests in parallel.
- Updating test commands in workflows to include the -n auto flag and a set of rerun options.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added pytest-rerunfailures dependency and updated pytest options. |
| .github/workflows/unit-tests.yaml | Replaced inline steps with a reusable workflow call. |
| .github/workflows/test-presets.yaml | Replaced inline steps with a reusable workflow call. |
| .github/workflows/test-optimization.yaml | Replaced inline steps with a reusable workflow call. |
| .github/workflows/test-nodes.yaml | Replaced inline steps with a reusable workflow call. |
| .github/workflows/test-inference.yaml | Replaced inline steps with a reusable workflow call. |
| .github/workflows/reusable-test.yaml | Introduced a reusable workflow for test execution across suites. |
| - name: setup poetry | ||
| run: | | ||
| curl -sSL https://install.python-poetry.org | python - | ||
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.
ты убрал эти строки для оптимизации потому что поэтри долго устанавливается?
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.
Я поменял на установку через pip и это теперь не обязательно. Но если ставить черзе pip то не ставятся тесты и падает дока, что кастати для пользователей тоже может быть неожиданно. Мб поменять импорт файлов в доке?
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.
тут проблема в том что напрямую из тестов достается датафайл:
path_to_dataset = ires.files("tests.assets.data").joinpath("clinc_subset.json")
надо просто туториал переписать, чтобы этого не было
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.
Да, я про это. Можно поменять на загрузку с HF
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.
Можно просто в папку с документацией положить clinc_subset.json или загрузить файл отдельно в репо на HF, и его потом загружать во время доки
* Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * update makefile * update bert test * mypy workaround * attempt to fix windows permission error * workaround --------- Co-authored-by: Darinochka <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]>
* added main code for saving models * Update optimizer_config.schema.json * checker fixes * Revert "checker fixes" This reverts commit 6e32eb9. * Revert "added main code for saving models" This reverts commit 5637fb8. * drat main code for new dumper * ruf fix * comments * added code for test dumper * Check dumper (#182) * Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * update makefile * update bert test * mypy workaround * attempt to fix windows permission error * workaround --------- Co-authored-by: Darinochka <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]>
* speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> # Conflicts: # pyproject.toml diff --git c/.github/workflows/build-docs.yaml i/.github/workflows/build-docs.yaml index 82a6896..c9d2d31 100644 --- c/.github/workflows/build-docs.yaml +++ i/.github/workflows/build-docs.yaml @@ -36,9 +36,12 @@ jobs: with: python-version: "3.10" - - name: setup poetry - run: | - curl -sSL https://install.python-poetry.org | python - + - name: Cache Hugging Face + id: cache-hf + uses: actions/cache@v4 + with: + path: ~/.cache/huggingface + key: docs-cache-hf - name: Install pandoc run: | @@ -46,23 +49,23 @@ jobs: - name: Install dependencies run: | - poetry install --with docs + pip install .[docs] - name: Run tests if: github.event_name != 'workflow_dispatch' run: | echo "Testing documentation build..." - make test-docs + python -m sphinx build -b doctest docs/source docs/build/html - name: Build documentation if: ${{ github.ref == 'refs/heads/dev' }} && github.event_name != 'workflow_dispatch' run: | - make docs + python -m sphinx build -b html docs/source docs/build/html - name: build multiversion documentation if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' run: | - make multi-version-docs + sphinx-multiversion docs/source docs/build/html - name: Deploy to GitHub Pages uses: peaceiris/actions-gh-pages@v3 diff --git c/.github/workflows/reusable-test.yaml i/.github/workflows/reusable-test.yaml new file mode 100644 index 00000000..ac8f0b1 --- /dev/null +++ i/.github/workflows/reusable-test.yaml @@ -0,0 +1,46 @@ +name: Reusable Test Workflow + +on: + workflow_call: + inputs: + test_command: + required: true + type: string + description: 'Command to run tests' + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ ubuntu-latest ] + python-version: [ "3.10", "3.11", "3.12" ] + include: + - os: windows-latest + python-version: "3.10" + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache Hugging Face + id: cache-hf + uses: actions/cache@v4 + with: + path: ~/.cache/huggingface + key: ${{ runner.os }}-hf + + - name: Setup Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + pip install .[test] + + - name: Run tests + run: | + ${{ inputs.test_command }} \ No newline at end of file diff --git c/.github/workflows/test-inference.yaml i/.github/workflows/test-inference.yaml index a68ef07..d89e450 100644 --- c/.github/workflows/test-inference.yaml +++ i/.github/workflows/test-inference.yaml @@ -8,31 +8,6 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10", "3.11", "3.12" ] - include: - - os: windows-latest - python-version: "3.10" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - pip install . - pip install pytest pytest-asyncio - - - name: Run tests - run: | - pytest tests/pipeline/test_inference.py + uses: ./.github/workflows/reusable-test.yaml + with: + test_command: pytest -n auto tests/pipeline/test_inference.py diff --git c/.github/workflows/test-nodes.yaml i/.github/workflows/test-nodes.yaml index b101617..c191491 100644 --- c/.github/workflows/test-nodes.yaml +++ i/.github/workflows/test-nodes.yaml @@ -8,31 +8,6 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10", "3.11", "3.12" ] - include: - - os: windows-latest - python-version: "3.10" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - pip install . - pip install pytest pytest-asyncio - - - name: Run tests - run: | - pytest tests/nodes + uses: ./.github/workflows/reusable-test.yaml + with: + test_command: pytest -n auto tests/nodes diff --git c/.github/workflows/test-optimization.yaml i/.github/workflows/test-optimization.yaml index 4625f39..ad3168d 100644 --- c/.github/workflows/test-optimization.yaml +++ i/.github/workflows/test-optimization.yaml @@ -8,31 +8,6 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10", "3.11", "3.12" ] - include: - - os: windows-latest - python-version: "3.10" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - pip install . - pip install pytest pytest-asyncio - - - name: Run tests - run: | - pytest tests/pipeline/test_optimization.py + uses: ./.github/workflows/reusable-test.yaml + with: + test_command: pytest -n auto tests/pipeline/test_optimization.py diff --git c/.github/workflows/test-presets.yaml i/.github/workflows/test-presets.yaml index ab4a672..836c58f 100644 --- c/.github/workflows/test-presets.yaml +++ i/.github/workflows/test-presets.yaml @@ -8,31 +8,6 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10", "3.11", "3.12" ] - include: - - os: windows-latest - python-version: "3.10" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - pip install . - pip install pytest pytest-asyncio - - - name: Run tests - run: | - pytest tests/pipeline/test_presets.py + uses: ./.github/workflows/reusable-test.yaml + with: + test_command: pytest -n auto tests/pipeline/test_presets.py diff --git c/.github/workflows/typing.yml i/.github/workflows/typing.yml index eb0c374..dfe873e 100644 --- c/.github/workflows/typing.yml +++ i/.github/workflows/typing.yml @@ -11,14 +11,9 @@ jobs: python-version: "3.10" cache: "pip" - - name: Install Poetry - run: | - curl -sSL https://install.python-poetry.org | python3 - - echo "$HOME/.poetry/bin" >> $GITHUB_PATH - - name: Install dependencies run: | - poetry install --with typing + pip install .[typing] - name: Run mypy - run: make typing + run: mypy autointent diff --git c/.github/workflows/unit-tests.yaml i/.github/workflows/unit-tests.yaml index 5883080..4d8164f 100644 --- c/.github/workflows/unit-tests.yaml +++ i/.github/workflows/unit-tests.yaml @@ -8,31 +8,6 @@ on: jobs: test: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest ] - python-version: [ "3.10", "3.11", "3.12" ] - include: - - os: windows-latest - python-version: "3.10" - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - pip install . - pip install pytest pytest-asyncio - - - name: Run tests - run: | - pytest --ignore=tests/nodes --ignore=tests/pipeline + uses: ./.github/workflows/reusable-test.yaml + with: + test_command: pytest -n auto --ignore=tests/nodes --ignore=tests/pipeline diff --git c/pyproject.toml i/pyproject.toml index ab78c4d..0994407 100644 --- c/pyproject.toml +++ i/pyproject.toml @@ -48,6 +48,44 @@ dependencies = [ "codecarbon (==2.6)", ] +[project.optional-dependencies] +dev = [ + "tach (>=0.11.3,<1.0.0)", + "ipykernel (>=6.29.5,<7.0.0)", + "ipywidgets (>=8.1.5,<9.0.0)", + "ruff (==0.8.4)", +] +test = [ + "pytest (>=8.3.2,<9.0.0)", + "pytest-cov (>=5.0.0,<6.0.0)", + "coverage (>=7.6.1,<8.0.0)", + "pytest-asyncio (>=0.24.0,<1.0.0)", + "pytest-rerunfailures (>=15.0,<16.0)", + "pytest-xdist (>=3.6.1,<4.0.0)", +] +typing = [ + "mypy (>=1,<2)", + "types-pyyaml (>=6.0.12.20240917,<7.0.0)", + "types-pygments (>=2.18.0.20240506,<3.0.0)", + "types-setuptools (>=75.2.0.20241019,<76.0.0)", + "joblib-stubs (>=1.4.2.5.20240918,<2.0.0)", +] +docs = [ + "sphinx (>=8.1.3,<9.0.0)", + "pydata-sphinx-theme (>=0.16.0,<1.0.0)", + "jupytext (>=1.16.4,<2.0.0)", + "nbsphinx (>=0.9.5,<1.0.0)", + "sphinx-autodoc-typehints (>=2.5.0,<3.0.0)", + "sphinx-copybutton (>=0.5.2,<1.0.0)", + "sphinx-autoapi (>=3.3.3,<4.0.0)", + "ipykernel (>=6.29.5,<7.0.0)", + "tensorboardx (>=2.6.2.2,<3.0.0)", + "sphinx-multiversion (>=0.2.4,<1.0.0)", +] +dspy = [ + "dspy (>=2.6.5,<3.0.0)", +] + [project.urls] Homepage = "https://deeppavlov.github.io/AutoIntent/" Repository = "https://github.com/deeppavlov/AutoIntent" @@ -57,56 +95,6 @@ Documentation = "https://deeppavlov.github.io/AutoIntent/" "basic-aug" = "autointent.generation.utterances.basic.cli:main" "evolution-aug" = "autointent.generation.utterances.evolution.cli:main" -[tool.poetry.group.dev] -optional = true - -[tool.poetry.group.dev.dependencies] -ipykernel = "^6.29.5" -ipywidgets = "^8.1.5" -ruff = "==0.8.4" - -[tool.poetry.group.test] -optional = true - -[tool.poetry.group.test.dependencies] -pytest = "8.3.2" -pytest-cov = "^5.0.0" -coverage = "^7.6.1" -pytest-asyncio = "^0.24.0" - -[tool.poetry.group.typing] -optional = true - -[tool.poetry.group.typing.dependencies] -mypy = "^1" -types-pyyaml = "^6.0.12.20240917" -types-pygments = "^2.18.0.20240506" -types-setuptools = "^75.2.0.20241019" -joblib-stubs = "^1.4.2.5.20240918" - -[tool.poetry.group.docs] -optional = true - -[tool.poetry.group.docs.dependencies] -sphinx = "^8.1.3" -pydata-sphinx-theme = "^0.16.0" -jupytext = "^1.16.4" -nbsphinx = "^0.9.5" -sphinx-autodoc-typehints = "^2.5.0" -sphinx-copybutton = "^0.5.2" -sphinx-autoapi = "^3.3.3" -ipykernel = "^6.29.5" -tensorboardx = "^2.6.2.2" -sphinx-multiversion = "^0.2.4" - -[tool.poetry.group.dspy] -optional = true - - -[tool.poetry.group.dspy.dependencies] -dspy = "^2.6.5" - - [tool.ruff] line-length = 120 indent-width = 4 @@ -148,11 +136,28 @@ build-backend = "poetry.core.masonry.api" [tool.pytest.ini_options] minversion = "8.0" -addopts = "-ra" # `--cov` option breaks pycharm's test debugger testpaths = [ "tests", ] pythonpath = "autointent" +# `--cov` option breaks pycharm's test debugger +addopts = """ + -ra + --reruns 3 + --only-rerun requests.exceptions.ReadTimeout + --only-rerun huggingface_hub.errors.HfHubHTTPError + --only-rerun huggingface_hub.errors.LocalEntryNotFoundError + --only-rerun FileNotFoundError + --only-rerun OSError + --durations 5 + --reruns-delay 10 +""" +# --reruns 3 -> # Retry failed tests 3 times +# requests.exceptions.ReadTimeout -> # HF Read timed out +# huggingface_hub.errors.HfHubHTTPError -> # HF is unavailable +# huggingface_hub.errors.LocalEntryNotFoundError -> # Gateway Time-out from HF +# FileNotFoundError -> HF Cache is broken +# --reruns-delay 10 -> Delay between reruns in seconds to avoid running into the same issue again [tool.coverage.run] branch = true diff --git c/user_guides/advanced/01_data.py i/user_guides/advanced/01_data.py index 27314a8..5177877 100644 --- c/user_guides/advanced/01_data.py +++ i/user_guides/advanced/01_data.py @@ -6,9 +6,8 @@ This chapter is a more detailed version of data chapter from basic user guide ab """ # %% -import importlib.resources as ires - import datasets +import huggingface_hub from autointent import Dataset @@ -180,7 +179,11 @@ The AutoIntent library includes sample datasets. """ # %% -path_to_dataset = ires.files("tests.assets.data").joinpath("clinc_subset.json") +path_to_dataset = huggingface_hub.hf_hub_download( + repo_id="DeepPavlov/clinc150_subset", + filename="clinc_subset.json", + repo_type="dataset", +) dataset = Dataset.from_json(path_to_dataset) # %% [markdown] diff --git c/user_guides/basic_usage/01_data.py i/user_guides/basic_usage/01_data.py index a03f39b..f56294a 100644 --- c/user_guides/basic_usage/01_data.py +++ i/user_guides/basic_usage/01_data.py @@ -6,9 +6,8 @@ In this chapter you will learn how to manipulate intent classification data with """ # %% -import importlib.resources as ires - import datasets +import huggingface_hub from autointent import Dataset @@ -53,7 +52,11 @@ After you converted your labeled data into JSON, you can load it into AutoIntent """ # %% -path_to_dataset = ires.files("tests.assets.data").joinpath("clinc_subset_unsplitted.json") +path_to_dataset = huggingface_hub.hf_hub_download( + repo_id="DeepPavlov/clinc150_subset", + filename="clinc_subset_unsplitted.json", + repo_type="dataset", +) dataset = Dataset.from_json(path_to_dataset) # %% [markdown]
* full tuning (#165) * Added code for full tuning * work on review * renaming * fix ruff * mypy test * ignote mypy * Feat/bert scorer config refactoring (#168) * refactor configs * add proper configs to BERTScorer * fix typing * fix tokenizer's parameters * fix transformers and accelerate issue * Update optimizer_config.schema.json * bug fix * update callback test * fix tests --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * delete validate_task * report_to * batches * Fix/docs building for bert scorer (#171) * fix * fix codestyle --------- Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * bert-scorer ending (#172) * batches * tests check * fix * return to torch * fix for tests * Fix/bert scorer (#174) * fix str and float issue and shrinken search space * update `inference node config` overriding logic * fix typing * fix codestyle * fix multilabel issue * attempt to fix `inference node config` bugs * another attempt --------- Co-authored-by: Алексеев Илья <[email protected]> * Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * dumper saving (#180) * added main code for saving models * Update optimizer_config.schema.json * checker fixes * Revert "checker fixes" This reverts commit 6e32eb9. * Revert "added main code for saving models" This reverts commit 5637fb8. * drat main code for new dumper * ruf fix * comments * added code for test dumper * Check dumper (#182) * Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * update makefile * update bert test * mypy workaround * attempt to fix windows permission error * workaround --------- Co-authored-by: Darinochka <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> * Update embedder prompt (#183) * Add trust remote code (#185) * lint * fix trust remote code * Update optimizer_config.schema.json * update fix trust remote code * fix test cllback --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Remove autointent org from docs (#186) * lint * update paths * feat: added crossencoder (#181) * feat: added crossencoder * refactor * feat: added arg similarity * Update optimizer_config.schema.json * feat: added tests * feat: added errors * fix: scoring test * fix: description vectors error * fix: description vectors error * fix: lint * fix: test * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * fix: unit tests * feat: added test for description * feat: delete encoder_type from the class args * feat: update assets * feat: update assets * fix: fixed test * Update optimizer_config.schema.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: voorhs <[email protected]> * Add few shot (#187) * init few shot * Update optimizer_config.schema.json * apply few shot to all * Update optimizer_config.schema.json * fix test * lint --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * update numpy typing (#188) * Lora scorer (#170) * added lora scorer * fix ruff * Update __init__.py * updated after mr #165 * Update pyproject.toml * fixed requested changes * fixed ruff failing * fixed remarks * Update optimizer_config.schema.json * added test * ruff fix * convert labels to float * Update autointent/modules/scoring/_lora/lora.py Co-authored-by: Roman Solomatin <[email protected]> * Update autointent/modules/scoring/_lora/lora.py Co-authored-by: Roman Solomatin <[email protected]> * change model_config name, added trust_remote_code * Update lora.py * inherited lora from bert * fix ruff * fix search space * Update lora.py * Update lora.py * added dump check * Update test_lora.py * Update test_lora.py * added docstring * fix ruff * Update test_lora.py * Update test_lora.py --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> * PTuningScorer (#178) * Initial commit of PTuningScorer module * Added peft (>=0.10.0, <0.15.0) in dependencies * Implement fit/predict PTuningScorer * Added PTuningScorer in __init__ file * Update optimizer_config.schema.json * Minor fixs * PGH00 * Refactor clear_cache in fit method * Refactor typing ignore + remove unnecessary * Fix fit method status check * Added test for PTuningScorer * Fix mypy typing * Update and fix peft version dependencies * Fix mypy typing * Added test in multiclass.yaml, multilabel.yaml * Update docs strings * Fix mypy typing * Added trust_remote_code * make proper rst reference * Added test for dump lod * feat: added crossencoder (#181) * feat: added crossencoder * refactor * feat: added arg similarity * Update optimizer_config.schema.json * feat: added tests * feat: added errors * fix: scoring test * fix: description vectors error * fix: description vectors error * fix: lint * fix: test * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * fix: unit tests * feat: added test for description * feat: delete encoder_type from the class args * feat: update assets * feat: update assets * fix: fixed test * Update optimizer_config.schema.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: voorhs <[email protected]> * Added fixed seed to test reproduction * Pull LoraScorer and Bert Refactor * Refactor PTuningScorer * Refactor test for ptuning * Fix typing * Fix multilabel multiclass tests * Fix typing --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> * Rerank scorer: опция для выбора источника для расчета вектора вероятностей (#115) * Enable rerank scorer to use crossencoder scores for the probability vector * add cross encoder scores range options * upd test --------- Co-authored-by: voorhs <[email protected]> * feat: add DISABLE_EMISSIONS_TRACKING (#191) * feat: add DISABLE_EMISSIONS_TRACKING * try to fix docs error * Update optimizer_config.schema.json * another attempt * Update optimizer_config.schema.json * i give up for now * Update optimizer_config.schema.json --------- Co-authored-by: voorhs <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix issue (#194) * Refactor/embedding caching (#195) * implement new hashing strategy * fix codestyle * Update optimizer_config.schema.json * minor bug fix * fix typing error * refactor similarity calculation * Update optimizer_config.schema.json * upd callback test * solve 429 error --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * forgot something --------- Co-authored-by: Сергей Малышев <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: VALERIA RUBANOVA <[email protected]> Co-authored-by: nikiduki <[email protected]> Co-authored-by: Dmitryv-2024 <[email protected]>
* add interruption handling * fix test * fix test * update * fix test * lint * remove step * use patch instead of monkeypatch * add n_jobs as param * change n_jobs to -1 * try fix * remove old study * add logging warning * Update optimizer_config.schema.json * lint * try dumping * lint * np encoder * update warning trigger * Fix/n trials issue (#196) * try to fix * fix typing errors * bug fix * Update autointent/nodes/_node_optimizer.py Co-authored-by: Roman Solomatin <[email protected]> --------- Co-authored-by: Roman Solomatin <[email protected]> * Fix/context not dumped error (#197) * try to fix * dump context constantly and fix serialization issues * add exclude option to dumper * fix codestyle and typing errors * try to fix file exists error * fix no fixture found error * Update interruption handling (#198) * full tuning (#165) * Added code for full tuning * work on review * renaming * fix ruff * mypy test * ignote mypy * Feat/bert scorer config refactoring (#168) * refactor configs * add proper configs to BERTScorer * fix typing * fix tokenizer's parameters * fix transformers and accelerate issue * Update optimizer_config.schema.json * bug fix * update callback test * fix tests --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * delete validate_task * report_to * batches * Fix/docs building for bert scorer (#171) * fix * fix codestyle --------- Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * bert-scorer ending (#172) * batches * tests check * fix * return to torch * fix for tests * Fix/bert scorer (#174) * fix str and float issue and shrinken search space * update `inference node config` overriding logic * fix typing * fix codestyle * fix multilabel issue * attempt to fix `inference node config` bugs * another attempt --------- Co-authored-by: Алексеев Илья <[email protected]> * Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * dumper saving (#180) * added main code for saving models * Update optimizer_config.schema.json * checker fixes * Revert "checker fixes" This reverts commit 6e32eb9. * Revert "added main code for saving models" This reverts commit 5637fb8. * drat main code for new dumper * ruf fix * comments * added code for test dumper * Check dumper (#182) * Feat/code carbon each node (#175) * feat: update codecarbon * feat: update codecarbon * feat: added codecarbon * Update optimizer_config.schema.json * fix: fixed import mypy * fix: codecarbon package * fix: only float\integer log * fix: codecarbon package * fix: mypy * fix: test * fix: delete emissions * fix: test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * standartize pyproject & speedup tests (#176) * speedup tests * fix pyproject * Update optimizer_config.schema.json * move optional dependencies * fixes * add xdist * fix ci * download data from hub in doc * add caching * add doc cache --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * add proper `omit` definition for tests coverage report (#179) * add proper `omit` definition * Update optimizer_config.schema.json * exclude tmp from coverage report --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * update makefile * update bert test * mypy workaround * attempt to fix windows permission error * workaround --------- Co-authored-by: Darinochka <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> * Update embedder prompt (#183) * Add trust remote code (#185) * lint * fix trust remote code * Update optimizer_config.schema.json * update fix trust remote code * fix test cllback --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Remove autointent org from docs (#186) * lint * update paths * feat: added crossencoder (#181) * feat: added crossencoder * refactor * feat: added arg similarity * Update optimizer_config.schema.json * feat: added tests * feat: added errors * fix: scoring test * fix: description vectors error * fix: description vectors error * fix: lint * fix: test * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * fix: unit tests * feat: added test for description * feat: delete encoder_type from the class args * feat: update assets * feat: update assets * fix: fixed test * Update optimizer_config.schema.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: voorhs <[email protected]> * Add few shot (#187) * init few shot * Update optimizer_config.schema.json * apply few shot to all * Update optimizer_config.schema.json * fix test * lint --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * update numpy typing (#188) * Lora scorer (#170) * added lora scorer * fix ruff * Update __init__.py * updated after mr #165 * Update pyproject.toml * fixed requested changes * fixed ruff failing * fixed remarks * Update optimizer_config.schema.json * added test * ruff fix * convert labels to float * Update autointent/modules/scoring/_lora/lora.py Co-authored-by: Roman Solomatin <[email protected]> * Update autointent/modules/scoring/_lora/lora.py Co-authored-by: Roman Solomatin <[email protected]> * change model_config name, added trust_remote_code * Update lora.py * inherited lora from bert * fix ruff * fix search space * Update lora.py * Update lora.py * added dump check * Update test_lora.py * Update test_lora.py * added docstring * fix ruff * Update test_lora.py * Update test_lora.py --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> * PTuningScorer (#178) * Initial commit of PTuningScorer module * Added peft (>=0.10.0, <0.15.0) in dependencies * Implement fit/predict PTuningScorer * Added PTuningScorer in __init__ file * Update optimizer_config.schema.json * Minor fixs * PGH00 * Refactor clear_cache in fit method * Refactor typing ignore + remove unnecessary * Fix fit method status check * Added test for PTuningScorer * Fix mypy typing * Update and fix peft version dependencies * Fix mypy typing * Added test in multiclass.yaml, multilabel.yaml * Update docs strings * Fix mypy typing * Added trust_remote_code * make proper rst reference * Added test for dump lod * feat: added crossencoder (#181) * feat: added crossencoder * refactor * feat: added arg similarity * Update optimizer_config.schema.json * feat: added tests * feat: added errors * fix: scoring test * fix: description vectors error * fix: description vectors error * fix: lint * fix: test * add node validators (#177) * add node validators * add comments * Update optimizer_config.schema.json * rename bert model * lint * fixes * fix test --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> * fix: unit tests * feat: added test for description * feat: delete encoder_type from the class args * feat: update assets * feat: update assets * fix: fixed test * Update optimizer_config.schema.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: voorhs <[email protected]> * Added fixed seed to test reproduction * Pull LoraScorer and Bert Refactor * Refactor PTuningScorer * Refactor test for ptuning * Fix typing * Fix multilabel multiclass tests * Fix typing --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: voorhs <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> * Rerank scorer: опция для выбора источника для расчета вектора вероятностей (#115) * Enable rerank scorer to use crossencoder scores for the probability vector * add cross encoder scores range options * upd test --------- Co-authored-by: voorhs <[email protected]> * feat: add DISABLE_EMISSIONS_TRACKING (#191) * feat: add DISABLE_EMISSIONS_TRACKING * try to fix docs error * Update optimizer_config.schema.json * another attempt * Update optimizer_config.schema.json * i give up for now * Update optimizer_config.schema.json --------- Co-authored-by: voorhs <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * fix issue (#194) * Refactor/embedding caching (#195) * implement new hashing strategy * fix codestyle * Update optimizer_config.schema.json * minor bug fix * fix typing error * refactor similarity calculation * Update optimizer_config.schema.json * upd callback test * solve 429 error --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * forgot something --------- Co-authored-by: Сергей Малышев <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Darinochka <[email protected]> Co-authored-by: Roman Solomatin <[email protected]> Co-authored-by: VALERIA RUBANOVA <[email protected]> Co-authored-by: nikiduki <[email protected]> Co-authored-by: Dmitryv-2024 <[email protected]> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Алексеев Илья <[email protected]> Co-authored-by: Сергей Малышев <[email protected]> Co-authored-by: Darinochka <[email protected]> Co-authored-by: VALERIA RUBANOVA <[email protected]> Co-authored-by: nikiduki <[email protected]> Co-authored-by: Dmitryv-2024 <[email protected]> Co-authored-by: voorhs <[email protected]>
tool.poetryinside toproject.optional-dependenciesto make it more compatible. To add new dependenciespoetry add name --optional group_name-n autoto pytest (n-numprocesses)