From a21ea6ea14efc6ac61e8ffd8c28d17c1374c7fe6 Mon Sep 17 00:00:00 2001 From: Brett Kuprel Date: Mon, 4 Jul 2022 07:28:44 -0400 Subject: [PATCH] update replicate, clear cuda cache if cuda available --- README.rst | 12 ++++++------ cog.yaml | 2 +- replicate/predict.py | 10 +++++----- setup.py | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.rst b/README.rst index 1871749..726495c 100644 --- a/README.rst +++ b/README.rst @@ -4,13 +4,13 @@ min(DALL·E) |Open In Colab|   |Replicate|   |Join us on Discord| This is a fast, minimal implementation of Boris Dayma’s `DALL·E -Mini `__. It has been stripped +Mega `__. It has been stripped down for inference and converted to PyTorch. The only third party dependencies are numpy, requests, pillow and torch. -To generate a 3x3 grid of DALL·E Mega images it takes - **35 seconds** -with a P100 in Colab - **15 seconds** with an A100 on Replicate - -**TBD** with an H100 (@NVIDIA?) +It takes - **35 seconds** to generate a 3x3 grid with a P100 in Colab - +**16 seconds** to generate a 4x4 grid with an A100 on Replicate - +**TBD** to generate a 4x4 grid with an H100 (@NVIDIA?) The flax model and code for converting it to torch can be found `here `__. @@ -40,7 +40,7 @@ not already there. Once everything has finished initializing, call .. code:: python - text = 'Dali painting of WallE' + text = 'Dali painting of WALL·E' image = model.generate_image(text, seed=0, grid_size=4) display(image) @@ -81,7 +81,7 @@ Use ``image_from_text.py`` to generate images from the command line. .. code:: bash - $ python image_from_text.py --text='artificial intelligence' --seed=7 + $ python image_from_text.py --text='artificial intelligence' --no-mega --seed=7 .. code:: bash diff --git a/cog.yaml b/cog.yaml index 55d328d..1453f1a 100644 --- a/cog.yaml +++ b/cog.yaml @@ -6,7 +6,7 @@ build: - "libgl1-mesa-glx" - "libglib2.0-0" python_packages: - - "min-dalle==0.2.13" + - "min-dalle==0.2.14" run: - pip install torch==1.10.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html diff --git a/replicate/predict.py b/replicate/predict.py index bbe39d0..f14d853 100644 --- a/replicate/predict.py +++ b/replicate/predict.py @@ -11,17 +11,17 @@ class Predictor(BasePredictor): self, text: str = Input( description='Text', - default='court sketch of godzilla on trial' + default='Dali painting of WALL·E' ), seed: int = Input( - description='Seed', - default=6 + description='Set the seed to a positive number for reproducible results', + default=-1 ), grid_size: int = Input( - description='Grid Size', + description='Size of the image grid', ge=1, le=4, - default=3 + default=4 ) ) -> Path: image = self.model.generate_image(text, seed, grid_size=grid_size) diff --git a/setup.py b/setup.py index 1949018..a55a824 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='min-dalle', description = 'min(DALL·E)', long_description=(Path(__file__).parent / "README.rst").read_text(), - version='0.2.13', + version='0.2.14', author='Brett Kuprel', author_email='brkuprel@gmail.com', url='https://github.com/kuprel/min-dalle',