min-dalle-test/min_dalle.ipynb

273 lines
149 KiB
Plaintext
Raw Normal View History

2022-06-28 00:58:17 +00:00
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
2022-06-29 02:12:36 +00:00
"id": "view-in-github",
"colab_type": "text"
2022-06-28 00:58:17 +00:00
},
"source": [
"<a href=\"https://colab.research.google.com/github/kuprel/min-dalle/blob/main/min_dalle.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "3WL-G_f2_ld8"
},
"source": [
"# min(DALL·E)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Zl_ZFisFApeh"
},
"source": [
"### Download models and install dependencies"
2022-06-28 00:58:17 +00:00
]
},
{
"cell_type": "code",
2022-06-29 14:37:12 +00:00
"execution_count": 1,
2022-06-28 00:58:17 +00:00
"metadata": {
2022-06-28 16:16:44 +00:00
"id": "ix_xt4X1_6F4",
2022-06-29 14:37:12 +00:00
"cellView": "code",
"outputId": "990a6f13-e242-4910-d6fe-20c438ca0f5e",
"colab": {
"base_uri": "https://localhost:8080/"
}
2022-06-28 00:58:17 +00:00
},
2022-06-29 14:37:12 +00:00
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into 'min-dalle'...\n",
"remote: Enumerating objects: 237, done.\u001b[K\n",
"remote: Counting objects: 100% (109/109), done.\u001b[K\n",
"remote: Compressing objects: 100% (55/55), done.\u001b[K\n",
"remote: Total 237 (delta 68), reused 79 (delta 53), pack-reused 128\u001b[K\n",
"Receiving objects: 100% (237/237), 679.18 KiB | 5.57 MiB/s, done.\n",
"Resolving deltas: 100% (128/128), done.\n",
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
" Dload Upload Total Spent Left Speed\n",
"100 234 100 234 0 0 832 0 --:--:-- --:--:-- --:--:-- 832\n",
"100 290M 100 290M 0 0 162M 0 0:00:01 0:00:01 --:--:-- 253M\n",
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
"Requirement already satisfied: torch in /usr/local/lib/python3.7/dist-packages (1.11.0+cu113)\n",
"Collecting flax==0.4.2\n",
" Downloading flax-0.4.2-py3-none-any.whl (186 kB)\n",
"\u001b[K |████████████████████████████████| 186 kB 7.6 MB/s \n",
"\u001b[?25hCollecting wandb\n",
" Downloading wandb-0.12.19-py2.py3-none-any.whl (1.8 MB)\n",
"\u001b[K |████████████████████████████████| 1.8 MB 40.0 MB/s \n",
"\u001b[?25hRequirement already satisfied: typing-extensions>=4.1.1 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (4.1.1)\n",
"Requirement already satisfied: jax>=0.3 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (0.3.8)\n",
"Requirement already satisfied: msgpack in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.0.4)\n",
"Collecting optax\n",
" Downloading optax-0.1.2-py3-none-any.whl (140 kB)\n",
"\u001b[K |████████████████████████████████| 140 kB 44.2 MB/s \n",
"\u001b[?25hRequirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (3.2.2)\n",
"Requirement already satisfied: numpy>=1.12 in /usr/local/lib/python3.7/dist-packages (from flax==0.4.2) (1.21.6)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.1.0)\n",
"Requirement already satisfied: scipy>=1.2.1 in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (1.4.1)\n",
"Requirement already satisfied: opt-einsum in /usr/local/lib/python3.7/dist-packages (from jax>=0.3->flax==0.4.2) (3.3.0)\n",
"Requirement already satisfied: Click!=8.0.0,>=7.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (7.1.2)\n",
"Requirement already satisfied: promise<3,>=2.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.3)\n",
"Requirement already satisfied: requests<3,>=2.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (2.23.0)\n",
"Collecting GitPython>=1.0.0\n",
" Downloading GitPython-3.1.27-py3-none-any.whl (181 kB)\n",
"\u001b[K |████████████████████████████████| 181 kB 62.2 MB/s \n",
"\u001b[?25hCollecting shortuuid>=0.5.0\n",
" Downloading shortuuid-1.0.9-py3-none-any.whl (9.4 kB)\n",
"Collecting docker-pycreds>=0.4.0\n",
" Downloading docker_pycreds-0.4.0-py2.py3-none-any.whl (9.0 kB)\n",
"Requirement already satisfied: six>=1.13.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (1.15.0)\n",
"Collecting setproctitle\n",
" Downloading setproctitle-1.2.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (29 kB)\n",
"Collecting sentry-sdk>=1.0.0\n",
" Downloading sentry_sdk-1.6.0-py2.py3-none-any.whl (145 kB)\n",
"\u001b[K |████████████████████████████████| 145 kB 56.3 MB/s \n",
"\u001b[?25hRequirement already satisfied: PyYAML in /usr/local/lib/python3.7/dist-packages (from wandb) (3.13)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.7/dist-packages (from wandb) (57.4.0)\n",
"Collecting pathtools\n",
" Downloading pathtools-0.1.2.tar.gz (11 kB)\n",
"Requirement already satisfied: protobuf<4.0dev,>=3.12.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (3.17.3)\n",
"Requirement already satisfied: psutil>=5.0.0 in /usr/local/lib/python3.7/dist-packages (from wandb) (5.4.8)\n",
"Collecting gitdb<5,>=4.0.1\n",
" Downloading gitdb-4.0.9-py3-none-any.whl (63 kB)\n",
"\u001b[K |████████████████████████████████| 63 kB 1.8 MB/s \n",
"\u001b[?25hCollecting smmap<6,>=3.0.1\n",
" Downloading smmap-5.0.0-py3-none-any.whl (24 kB)\n",
"Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (1.24.3)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2022.6.15)\n",
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (2.10)\n",
"Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3,>=2.0.0->wandb) (3.0.4)\n",
"Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (3.0.9)\n",
"Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (1.4.3)\n",
"Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (2.8.2)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib->flax==0.4.2) (0.11.0)\n",
"Requirement already satisfied: jaxlib>=0.1.37 in /usr/local/lib/python3.7/dist-packages (from optax->flax==0.4.2) (0.3.7+cuda11.cudnn805)\n",
"Collecting chex>=0.0.4\n",
" Downloading chex-0.1.3-py3-none-any.whl (72 kB)\n",
"\u001b[K |████████████████████████████████| 72 kB 612 kB/s \n",
"\u001b[?25hRequirement already satisfied: dm-tree>=0.1.5 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.1.7)\n",
"Requirement already satisfied: toolz>=0.9.0 in /usr/local/lib/python3.7/dist-packages (from chex>=0.0.4->optax->flax==0.4.2) (0.11.2)\n",
"Requirement already satisfied: flatbuffers<3.0,>=1.12 in /usr/local/lib/python3.7/dist-packages (from jaxlib>=0.1.37->optax->flax==0.4.2) (2.0)\n",
"Building wheels for collected packages: pathtools\n",
" Building wheel for pathtools (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Created wheel for pathtools: filename=pathtools-0.1.2-py3-none-any.whl size=8806 sha256=af02152f26ba54e536ef8b4cd3a7d9490a077a905a3f34585a8d50388d8559be\n",
" Stored in directory: /root/.cache/pip/wheels/3e/31/09/fa59cef12cdcfecc627b3d24273699f390e71828921b2cbba2\n",
"Successfully built pathtools\n",
"Installing collected packages: smmap, gitdb, chex, shortuuid, setproctitle, sentry-sdk, pathtools, optax, GitPython, docker-pycreds, wandb, flax\n",
"Successfully installed GitPython-3.1.27 chex-0.1.3 docker-pycreds-0.4.0 flax-0.4.2 gitdb-4.0.9 optax-0.1.2 pathtools-0.1.2 sentry-sdk-1.6.0 setproctitle-1.2.3 shortuuid-1.0.9 smmap-5.0.0 wandb-0.12.19\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading dataset artifact dalle-mini/dalle-mini/mini-1:v0\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact mini-1:v0, 1673.43MB. 7 files... Done. 0:0:15.8\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Artifact downloaded to /content/min-dalle/pretrained/dalle_bart_mini\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading dataset artifact dalle-mini/dalle-mini/mega-1-fp16:v14\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact mega-1-fp16:v14, 4938.53MB. 7 files... Done. 0:0:45.9\n",
"\u001b[34m\u001b[1mwandb\u001b[0m: Artifact downloaded to /content/min-dalle/pretrained/dalle_bart_mega\n"
]
}
],
2022-06-28 00:58:17 +00:00
"source": [
"! git clone https://github.com/kuprel/min-dalle\n",
2022-06-29 02:12:36 +00:00
"! mkdir -p /content/min-dalle/pretrained/vqgan/\n",
"! curl https://huggingface.co/dalle-mini/vqgan_imagenet_f16_16384/resolve/main/flax_model.msgpack -L --output /content/min-dalle/pretrained/vqgan/flax_model.msgpack\n",
2022-06-28 15:01:31 +00:00
"! pip install torch flax==0.4.2 wandb\n",
"! wandb login --anonymously\n",
2022-06-29 10:44:07 +00:00
"! wandb artifact get --root=/content/min-dalle/pretrained/dalle_bart_mini dalle-mini/dalle-mini/mini-1:v0\n",
"! wandb artifact get --root=/content/min-dalle/pretrained/dalle_bart_mega dalle-mini/dalle-mini/mega-1-fp16:v14\n"
2022-06-28 00:58:17 +00:00
]
},
{
"cell_type": "markdown",
"source": [
2022-06-29 14:37:12 +00:00
"### Load Model\n",
"Note: mega requires the high-RAM runtime type, uncheck it if you're using standard"
],
"metadata": {
"id": "kViq2dMbGDKt"
}
},
{
"cell_type": "code",
"source": [
"import os\n",
"os.chdir('/content/min-dalle')\n",
"from min_dalle.min_dalle_torch import MinDalleTorch\n",
"from min_dalle.min_dalle_flax import MinDalleFlax\n",
"\n",
2022-06-29 14:37:12 +00:00
"mega = True #@param {type:\"boolean\"}\n",
"torch = True #@param {type:\"boolean\"}\n",
"\n",
"model = MinDalleTorch(mega) if torch else MinDalleFlax(mega)\n"
],
"metadata": {
"id": "8W-L2ICFGFup",
2022-06-29 14:37:12 +00:00
"outputId": "822f4b7b-9dfe-46fe-e034-1cefeeea7fd5",
"colab": {
"base_uri": "https://localhost:8080/"
}
},
2022-06-29 14:37:12 +00:00
"execution_count": 2,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
2022-06-29 14:37:12 +00:00
"reading files from pretrained/dalle_bart_mega\n",
"initializing MinDalleTorch\n",
"loading encoder\n",
"loading decoder\n"
]
}
]
},
2022-06-28 00:58:17 +00:00
{
"cell_type": "markdown",
2022-06-28 15:01:31 +00:00
"metadata": {
2022-06-28 15:05:59 +00:00
"id": "c52TV1GbBNgS"
},
"source": [
"### Generate an Image"
]
2022-06-28 00:58:17 +00:00
},
{
"cell_type": "code",
2022-06-29 14:37:12 +00:00
"execution_count": 21,
2022-06-28 00:58:17 +00:00
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
2022-06-29 14:37:12 +00:00
"height": 494
2022-06-28 15:05:59 +00:00
},
"id": "nQ0UG05dA4p2",
2022-06-29 14:37:12 +00:00
"outputId": "6fd78b5c-f6b7-465b-a644-4e548bf6c749"
2022-06-28 00:58:17 +00:00
},
"outputs": [
{
2022-06-28 16:16:44 +00:00
"output_type": "stream",
2022-06-29 02:12:36 +00:00
"name": "stdout",
2022-06-28 00:58:17 +00:00
"text": [
"tokenizing text\n",
2022-06-29 14:37:12 +00:00
"['Ġa']\n",
"['Ġcomfy']\n",
"['Ġchair']\n",
"['Ġthat']\n",
"['Ġlooks']\n",
"['Ġlike']\n",
"['Ġan']\n",
"['Ġavocado']\n",
"text tokens [0, 58, 29872, 2408, 766, 4126, 1572, 101, 16632, 2]\n",
2022-06-28 00:58:17 +00:00
"encoding text tokens\n",
"sampling image tokens\n",
"detokenizing image\n"
]
},
{
2022-06-29 02:12:36 +00:00
"output_type": "display_data",
2022-06-28 00:58:17 +00:00
"data": {
"text/plain": [
2022-06-29 14:37:12 +00:00
"<PIL.Image.Image image mode=RGB size=256x256 at 0x7F0998C01A90>"
2022-06-29 02:12:36 +00:00
],
2022-06-29 14:37:12 +00:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAEAAElEQVR4nFz9WbctSXIeiH1m5h4Rezj7nHPPnXOsrEKhMBEcxGYvtVrNltbSi/6H3vQHtPQkkdJLc0lsruYS2ZS6m6I4gCSaxECgCTZJAAQIkCDGQhWAysrMyunOZ9pjRLib6cHcY5/kBarq3jPE9nC34bPPBqff+Le/NiSSPnMTLGfADMrEChCTGQgGEGAEAmj6PzODwWBM5F8BAP8f899TYoL/kH+DyMwIsOmnCTCoKQAmMqtPIgLM1J9jxPWL5r8HA/zr/nAYiACQ4fh8AhHDzJ8DJioL9LfxxxgZlGhaNvzv5TlWvkNEZqZq5Q2pvuu0HiMzZS6PMdQdIYPVzfM3sPJivh6bdg4ww/TRdYN9PfWB/nHsX/I/RDAw6g9NL2LTeZjV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zOqTzQFQfaPiOKv19fW4GBZ0Uj7+TqbAX0MnXmFyVu4oFEf9QHmMHaOoCdwU44eCJty4Hy24Fg7JLQ0IILsT2JYgBgoImSoM4LIAK0pJmo08IK4m1TejgJPsyuNGFwBpobg8uhZfskIJUHOPUh7ii5qAbv1Tvqha0PDk9KpVIEzCeJSQaduK/bSv7AgICMWJVcvnnEaBhagJsfozJcouBvSOHGNKEx/JAcA8PrsDueHGhDydX11epUemD6vKNinEXatrU7Klglkqr+YGqpIr5flFOotddPW9g2xt0iYiTPQmat6RCjF/l6WpL1SOySY7Oj0HdqQSyg9MamlcFNntPVV3UGMmAtw1gcCe7ylIsrgXm/AvCCRMZoUMnPynO64CqGjaMFctEoIxSD3gsfrpJ
2022-06-28 00:58:17 +00:00
},
2022-06-29 02:12:36 +00:00
"metadata": {}
2022-06-28 00:58:17 +00:00
}
2022-06-28 15:05:59 +00:00
],
"source": [
2022-06-29 14:37:12 +00:00
"text = \"a comfy chair that looks like an avocado\" #@param {type:\"string\"}\n",
"seed = 10 #@param {type:\"integer\"}\n",
2022-06-28 15:05:59 +00:00
"\n",
"image = model.generate_image(text, seed)\n",
2022-06-28 15:05:59 +00:00
"display(image)"
2022-06-28 00:58:17 +00:00
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
2022-06-28 15:05:59 +00:00
"collapsed_sections": [
"Zl_ZFisFApeh"
],
2022-06-28 16:16:44 +00:00
"name": "min-dalle",
2022-06-29 02:12:36 +00:00
"provenance": [],
2022-06-29 14:37:12 +00:00
"machine_shape": "hm",
"authorship_tag": "ABX9TyOumuwIf8/rWSedMHHbCa2e",
2022-06-29 02:12:36 +00:00
"include_colab_link": true
2022-06-28 00:58:17 +00:00
},
"gpuClass": "standard",
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 0
2022-06-29 02:12:36 +00:00
}