Skip to content

Commit

Permalink
Update pypi workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
xpai committed Apr 5, 2024
1 parent e4d6045 commit 42fa7a6
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
34 changes: 17 additions & 17 deletions .github/workflows/jupyter-book.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# name: jupyter-book
name: jupyter-book

# # Only run this when the master branch changes
# on:
# push:
# branches:
# - main
# Only run this when the master branch changes
on:
push:
branches:
- main

# # This job installs dependencies, build the book, and pushes it to `gh-pages`
# jobs:
# deploy-book:
# runs-on: ubuntu-latest
# steps:
# # Install dependencies
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v3
# with:
# python-version: 3.7
# - run: pip install jupyter-book
# This job installs dependencies, build the book, and pushes it to `gh-pages`
jobs:
deploy-book:
runs-on: ubuntu-latest
steps:
# Install dependencies
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.7
- run: pip install jupyter-book

# # Build the book
# - name: Build the book
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ on:
workflow_dispatch:

jobs:
build:
name: Build wheel distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Build a binary wheel and a source tarball
run: |
pip install wheel
python setup.py sdist bdist_wheel
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

pypi-publish:
name: upload to pypi
runs-on: ubuntu-latest
Expand All @@ -16,6 +35,10 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
# retrieve your distributions here
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to pypi
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion fuxictr/pytorch/models/rank_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def checkpoint_and_earlystop(self, logs, min_delta=1e-6):
self.save_weights(self.checkpoint)
if self._stopping_steps >= self._early_stop_patience:
self._stop_training = True
logging.info("********* Epoch=={} early stop *********".format(self._epoch_index + 1))
logging.info("********* Epoch={} early stop *********".format(self._epoch_index + 1))
if not self._save_best_only:
self.save_weights(self.checkpoint)

Expand Down

0 comments on commit 42fa7a6

Please sign in to comment.