dtype dropdown in colab
This commit is contained in:
parent
1ffdef9a56
commit
cfb9f60b6e
2
README.md
vendored
2
README.md
vendored
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
[![Discord](https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white)](https://discord.com/channels/823813159592001537/912729332311556136)
|
[![Discord](https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white)](https://discord.com/channels/823813159592001537/912729332311556136)
|
||||||
|
|
||||||
This is a fast, minimal port of Boris Dayma's [DALL·E Mega](https://github.com/borisdayma/dalle-mini). It has been stripped down for inference and converted to PyTorch. The only third party dependencies are numpy, requests, pillow and torch.
|
This is a fast, minimal port of [DALL·E Mega](https://github.com/borisdayma/dalle-mini). 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 4x4 grid of DALL·E Mega images it takes:
|
To generate a 4x4 grid of DALL·E Mega images it takes:
|
||||||
- 89 sec with a T4 in Colab
|
- 89 sec with a T4 in Colab
|
||||||
|
|
5
min_dalle.ipynb
vendored
5
min_dalle.ipynb
vendored
|
@ -102,7 +102,7 @@
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"### Load Model\n",
|
"### Load Model\n",
|
||||||
"Float32 is faster but uses more GPU memory. Change the `grid_size` to 3 or less if using float32."
|
"`float32` is faster than `float16` but uses more GPU memory. Change the `grid_size` to 3 or less if using `float32`."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -128,13 +128,14 @@
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
|
"dtype = \"float32\" #@param [\"float32\", \"float16\", \"bfloat16\"]\n",
|
||||||
"from IPython.display import display, update_display\n",
|
"from IPython.display import display, update_display\n",
|
||||||
"from math import log2\n",
|
"from math import log2\n",
|
||||||
"import torch\n",
|
"import torch\n",
|
||||||
"from min_dalle import MinDalle\n",
|
"from min_dalle import MinDalle\n",
|
||||||
"\n",
|
"\n",
|
||||||
"model = MinDalle(\n",
|
"model = MinDalle(\n",
|
||||||
" dtype=torch.float16,\n",
|
" dtype=getattr(torch, dtype),\n",
|
||||||
" is_mega=True, \n",
|
" is_mega=True, \n",
|
||||||
" is_reusable=True\n",
|
" is_reusable=True\n",
|
||||||
")"
|
")"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user