From 23ac06d96532832fd1de44041cb7f376c35aea2e Mon Sep 17 00:00:00 2001 From: Suraj Pai <bspai@bwh.harvard.edu> Date: Tue, 28 May 2024 17:54:19 -0400 Subject: [PATCH] Update docs and Ci #120 --- .github/workflows/auto-publish.yml | 29 ++++++++++++----------------- .github/workflows/build.yml | 2 +- .github/workflows/greetings.yml | 16 ---------------- docs/basics/quickstart.md | 17 +++++++++++++++++ pyproject.toml | 2 +- 5 files changed, 31 insertions(+), 35 deletions(-) delete mode 100644 .github/workflows/greetings.yml diff --git a/.github/workflows/auto-publish.yml b/.github/workflows/auto-publish.yml index ebcf79a9..85862d70 100644 --- a/.github/workflows/auto-publish.yml +++ b/.github/workflows/auto-publish.yml @@ -12,15 +12,17 @@ jobs: - name: Set up Python uses: actions/setup-python@v2.2.2 with: - python-version: 3.8 + python-version: 3.9 - name: Install poetry run: make setup - + + - name: Install poeblix for version freezing + run: poetry self add poeblix@latest + - name: Bump version run: | poetry version prerelease - - name: Commit changes run: | @@ -28,21 +30,14 @@ jobs: git config --local user.name "GitHub Action" git add . git commit -m "Bump version" || echo "No changes to commit" - - - - name: Update diagram - uses: githubocto/repo-visualizer@main - with: - excluded_paths: "ignore,.github" - should_push: false - + - name: Push changes run: git push + + - name: Build with lockfile versions + run: poetry blixbuild --only-lock - - name: Build and publish to pypi - uses: JRubics/poetry-publish@v1.16 + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: - python_version: 3.8 - pypi_token: ${{ secrets.PYPI_TOKEN }} - allow_poetry_pre_release: "yes" - ignore_dev_requirements: "yes" + password: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9db0c7f4..c1700bb1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/greetings.yml b/.github/workflows/greetings.yml deleted file mode 100644 index 955d5c30..00000000 --- a/.github/workflows/greetings.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Greetings - -on: [pull_request, issues] - -jobs: - greeting: - runs-on: ubuntu-latest - steps: - - uses: actions/first-interaction@v1 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - pr-message: 'Hello @${{ github.actor }}, thank you for submitting a PR! We will respond as soon as possible.' - issue-message: | - Hello @${{ github.actor }}, thank you for your interest in our work! - - If this is a bug report, please provide screenshots and **minimum viable code to reproduce your issue** diff --git a/docs/basics/quickstart.md b/docs/basics/quickstart.md index 59c08111..a3fc8d14 100644 --- a/docs/basics/quickstart.md +++ b/docs/basics/quickstart.md @@ -70,6 +70,13 @@ system: - _target_: torchvision.transforms.Normalize mean: [0.5, 0.5, 0.5] std: [0.5, 0.5, 0.5] + + postprocessing: + # Format the batch as required by Lighter as lighter + # takes a dictionary as input. + batch: + train: '$lambda x: {"input": x[0], "target": x[1]}' + ``` For more information about each of the LighterSystem components and how to override them, see [here](./config.md) @@ -79,6 +86,10 @@ We just combine the Trainer and LighterSystem into a single YAML and run the com === "cifar10.yaml" ```yaml + trainer: + _target_: pytorch_lightning.Trainer + max_epochs: 100 + system: _target_: lighter.LighterSystem batch_size: 512 @@ -109,6 +120,12 @@ We just combine the Trainer and LighterSystem into a single YAML and run the com mean: [0.5, 0.5, 0.5] std: [0.5, 0.5, 0.5] + postprocessing: + # Format the batch as required by Lighter as lighter + # takes a dictionary as input. + batch: + train: '$lambda x: {"input": x[0], "target": x[1]}' + ``` === "Terminal" ``` diff --git a/pyproject.toml b/pyproject.toml index 9de57996..6b7e3bd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,7 @@ classifiers = [ #! Update me [tool.poetry.dependencies] -python = "^3.8" +python = "^3.9" torch = "^2.1.2" pandas = "^1.5.3" pytorch-lightning = "^2.1.3"