diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..5f38eed --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,38 @@ + + +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Upload Python Package + +on: + release: + types: [published] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/README.md b/README.md index fd9a4e8..0f01950 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Implementation of DALL-E 2, OpenAI's updated text-to-image synthesis neural network, in Pytorch +This is SOTA for text-to-image now, but probably not for long. + ## Citations ```bibtex diff --git a/dalle2_pytorch/__init__.py b/dalle2_pytorch/__init__.py new file mode 100644 index 0000000..93dc539 --- /dev/null +++ b/dalle2_pytorch/__init__.py @@ -0,0 +1 @@ +from dalle2_pytorch.dalle2_pytorch import DALLE2 diff --git a/dalle2_pytorch/dalle2_pytorch.py b/dalle2_pytorch/dalle2_pytorch.py new file mode 100644 index 0000000..88865e5 --- /dev/null +++ b/dalle2_pytorch/dalle2_pytorch.py @@ -0,0 +1,11 @@ +import torch +import torch.nn.functional as F +from torch import nn, einsum +from einops import rearrange + +class DALLE2(nn.Module): + def __init__(self): + super().__init__() + + def forward(self, x): + return x diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..bcfcd3a --- /dev/null +++ b/setup.py @@ -0,0 +1,28 @@ +from setuptools import setup, find_packages + +setup( + name = 'dalle2-pytorch', + packages = find_packages(exclude=[]), + version = '0.0.1', + license='MIT', + description = 'DALL-E 2', + author = 'Phil Wang', + author_email = 'lucidrains@gmail.com', + url = 'https://github.com/lucidrains/dalle2-pytorch', + keywords = [ + 'artificial intelligence', + 'deep learning', + 'text to image' + ], + install_requires=[ + 'einops>=0.4', + 'torch>=1.6', + ], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Topic :: Scientific/Engineering :: Artificial Intelligence', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3.6', + ], +)