diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..cae905c --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,37 @@ +name: Release + +on: + push: + branches: + - master +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-ecosystem/action-regex-match@v2 + id: regex-match + with: + text: ${{ github.event.head_commit.message }} + regex: '^Release ([^ ]+)' + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Release + if: ${{ steps.regex-match.outputs.match != '' }} + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.regex-match.outputs.group1 }} + - name: Build and publish + if: ${{ steps.regex-match.outputs.match != '' }} + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* \ No newline at end of file diff --git a/.gitignore b/.gitignore index e763fde..f549f3d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ __pycache__ out* *.egg-info *.ini +.env \ No newline at end of file diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5256486..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "CLIP"] - path = CLIP - url = https://github.com/openai/CLIP diff --git a/CLIP b/CLIP deleted file mode 160000 index 40f5484..0000000 --- a/CLIP +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 40f5484c1c74edd83cb9cf687c6ab92b28d8b656 diff --git a/README.md b/README.md index d6d5232..e3622f9 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,11 @@ The models are denoising diffusion probabilistic models (https://arxiv.org/abs/2 Thank you to [stability.ai](https://www.stability.ai) for compute to train these models! -## Dependencies +## Installation -- PyTorch ([installation instructions](https://pytorch.org/get-started/locally/)) +`pip install v-diffusion-pytorch` -- requests, tqdm (install with `pip install`) - -- CLIP (https://github.com/openai/CLIP), and its additional pip-installable dependencies: ftfy, regex. **If you `git clone --recursive` this repo, it should fetch CLIP automatically.** +or git clone then `pip install -e .` ## Model checkpoints: diff --git a/requirements.txt b/requirements.txt index 8ae0557..ecbe65b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,3 +5,4 @@ Pillow torch torchvision tqdm +clip-anytorch diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..be56875 --- /dev/null +++ b/setup.py @@ -0,0 +1,5 @@ +from setuptools import setup + + +if __name__ == '__main__': + setup() \ No newline at end of file