Spaces:
Running
Running
feat: update wandb inference
Browse files
dev/inference/samples.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
white snow covered mountain under blue sky during daytime
|
2 |
-
aerial view of the beach at night
|
3 |
aerial view of the beach during daytime
|
|
|
4 |
a beautiful sunset at a beach with a shell on the shore
|
5 |
a farmhouse surrounded by beautiful flowers
|
6 |
a photo of a fantasy version of New York City
|
@@ -29,6 +29,7 @@ an avocado armchair flying into space
|
|
29 |
a cute avocado armchair singing karaoke on stage in front of a crowd of strawberry shaped lamps
|
30 |
an illustration of an avocado in a christmas sweater staring at its reflection in a mirror
|
31 |
illustration of an avocado armchair
|
|
|
32 |
illustration of an avocado armchair getting married to a pineapple
|
33 |
a muscular banana sitting upright on a bench smoking watching a banana on television, high definition photography
|
34 |
Mohammed Ali and Mike Tyson in a hypothetical match
|
@@ -48,6 +49,8 @@ a dog eating worthlessness
|
|
48 |
an elephant made of carrots
|
49 |
an elephant on a unicycle during a circus
|
50 |
photography of a penguin watching television
|
|
|
|
|
51 |
rat wearing a crown
|
52 |
a portrait of a nightmare creature watching at you
|
53 |
a white room full of a black substance
|
@@ -66,6 +69,8 @@ Cartoon of a carrot with big eyes
|
|
66 |
logo of a robot wearing glasses and reading a book
|
67 |
a bottle of coca-cola on a table
|
68 |
a cactus lifting weights
|
|
|
|
|
69 |
a living room with two white armchairs and a painting of the collosseum. The painting is mounted above a modern fireplace.
|
70 |
a long line of alternating green and red blocks
|
71 |
a long line of green blocks on a beach at subset
|
|
|
1 |
white snow covered mountain under blue sky during daytime
|
|
|
2 |
aerial view of the beach during daytime
|
3 |
+
aerial view of the beach at night
|
4 |
a beautiful sunset at a beach with a shell on the shore
|
5 |
a farmhouse surrounded by beautiful flowers
|
6 |
a photo of a fantasy version of New York City
|
|
|
29 |
a cute avocado armchair singing karaoke on stage in front of a crowd of strawberry shaped lamps
|
30 |
an illustration of an avocado in a christmas sweater staring at its reflection in a mirror
|
31 |
illustration of an avocado armchair
|
32 |
+
illustration of an armchair in the shape of an avocado
|
33 |
illustration of an avocado armchair getting married to a pineapple
|
34 |
a muscular banana sitting upright on a bench smoking watching a banana on television, high definition photography
|
35 |
Mohammed Ali and Mike Tyson in a hypothetical match
|
|
|
49 |
an elephant made of carrots
|
50 |
an elephant on a unicycle during a circus
|
51 |
photography of a penguin watching television
|
52 |
+
a penguin is walking on the Moon, Earth is in the background
|
53 |
+
a penguin standing on a tower of books holds onto a rope from a helicopter
|
54 |
rat wearing a crown
|
55 |
a portrait of a nightmare creature watching at you
|
56 |
a white room full of a black substance
|
|
|
69 |
logo of a robot wearing glasses and reading a book
|
70 |
a bottle of coca-cola on a table
|
71 |
a cactus lifting weights
|
72 |
+
illustration of a cactus lifting weigths
|
73 |
+
logo of a cactus lifting weights
|
74 |
a living room with two white armchairs and a painting of the collosseum. The painting is mounted above a modern fireplace.
|
75 |
a long line of alternating green and red blocks
|
76 |
a long line of green blocks on a beach at subset
|
dev/inference/wandb-backend.ipynb
CHANGED
@@ -47,7 +47,10 @@
|
|
47 |
"metadata": {},
|
48 |
"outputs": [],
|
49 |
"source": [
|
50 |
-
"run_ids = ['
|
|
|
|
|
|
|
51 |
"ENTITY, PROJECT = 'dalle-mini', 'dalle-mini' # used only for training run\n",
|
52 |
"VQGAN_REPO, VQGAN_COMMIT_ID = 'dalle-mini/vqgan_imagenet_f16_16384', None\n",
|
53 |
"normalize_text = True\n",
|
@@ -115,16 +118,6 @@
|
|
115 |
" return logits"
|
116 |
]
|
117 |
},
|
118 |
-
{
|
119 |
-
"cell_type": "code",
|
120 |
-
"execution_count": null,
|
121 |
-
"id": "ebf4f7bf-2efa-46cc-b3f4-2d7a54f7b2cb",
|
122 |
-
"metadata": {},
|
123 |
-
"outputs": [],
|
124 |
-
"source": [
|
125 |
-
"clip_params['logit_scale']"
|
126 |
-
]
|
127 |
-
},
|
128 |
{
|
129 |
"cell_type": "code",
|
130 |
"execution_count": null,
|
@@ -286,7 +279,8 @@
|
|
286 |
"\n",
|
287 |
" # generate images\n",
|
288 |
" images = []\n",
|
289 |
-
"
|
|
|
290 |
" key, subkey = jax.random.split(key)\n",
|
291 |
" encoded_images = p_generate(tokenized_prompt, shard_prng_key(subkey), model_params)\n",
|
292 |
" encoded_images = encoded_images.sequences[..., 1:]\n",
|
@@ -296,7 +290,7 @@
|
|
296 |
" images.append(Image.fromarray(np.asarray(img * 255, dtype=np.uint8)))\n",
|
297 |
"\n",
|
298 |
" # get clip scores\n",
|
299 |
-
"
|
300 |
" clip_inputs = processor(text=batch, images=images, return_tensors='np', padding='max_length', max_length=77, truncation=True).data\n",
|
301 |
" # each shard will have one prompt, images need to be reorganized to be associated to the correct shard\n",
|
302 |
" images_per_prompt_indices = np.asarray(range(0, len(images), batch_size))\n",
|
|
|
47 |
"metadata": {},
|
48 |
"outputs": [],
|
49 |
"source": [
|
50 |
+
"run_ids = ['he9rrc3q']\n",
|
51 |
+
"# poorly shuffled 1nj161cl\n",
|
52 |
+
"# well shuffled he9rrc3q\n",
|
53 |
+
"# non normalized 1fwxpyfh ! requires changing normalize_text\n",
|
54 |
"ENTITY, PROJECT = 'dalle-mini', 'dalle-mini' # used only for training run\n",
|
55 |
"VQGAN_REPO, VQGAN_COMMIT_ID = 'dalle-mini/vqgan_imagenet_f16_16384', None\n",
|
56 |
"normalize_text = True\n",
|
|
|
118 |
" return logits"
|
119 |
]
|
120 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
{
|
122 |
"cell_type": "code",
|
123 |
"execution_count": null,
|
|
|
279 |
"\n",
|
280 |
" # generate images\n",
|
281 |
" images = []\n",
|
282 |
+
" pbar = tqdm(range(num_images // jax.device_count()), desc='Generating Images', leave=None)\n",
|
283 |
+
" for i in pbar:\n",
|
284 |
" key, subkey = jax.random.split(key)\n",
|
285 |
" encoded_images = p_generate(tokenized_prompt, shard_prng_key(subkey), model_params)\n",
|
286 |
" encoded_images = encoded_images.sequences[..., 1:]\n",
|
|
|
290 |
" images.append(Image.fromarray(np.asarray(img * 255, dtype=np.uint8)))\n",
|
291 |
"\n",
|
292 |
" # get clip scores\n",
|
293 |
+
" pbar.set_description('Calculating CLIP scores')\n",
|
294 |
" clip_inputs = processor(text=batch, images=images, return_tensors='np', padding='max_length', max_length=77, truncation=True).data\n",
|
295 |
" # each shard will have one prompt, images need to be reorganized to be associated to the correct shard\n",
|
296 |
" images_per_prompt_indices = np.asarray(range(0, len(images), batch_size))\n",
|