Spaces:
Running
Running
fix forced bos token, also applying BART model to 8 samples now
Browse files- demo/demo_notebook.ipynb +156 -68
demo/demo_notebook.ipynb
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
-
"execution_count":
|
15 |
"metadata": {
|
16 |
"colab": {
|
17 |
"base_uri": "https://localhost:8080/"
|
@@ -27,7 +27,7 @@
|
|
27 |
},
|
28 |
{
|
29 |
"cell_type": "code",
|
30 |
-
"execution_count":
|
31 |
"metadata": {
|
32 |
"id": "M1wVkrpjU6zO"
|
33 |
},
|
@@ -39,7 +39,7 @@
|
|
39 |
},
|
40 |
{
|
41 |
"cell_type": "code",
|
42 |
-
"execution_count":
|
43 |
"metadata": {},
|
44 |
"outputs": [
|
45 |
{
|
@@ -65,7 +65,7 @@
|
|
65 |
},
|
66 |
{
|
67 |
"cell_type": "code",
|
68 |
-
"execution_count":
|
69 |
"metadata": {
|
70 |
"id": "9jQnM6S2vCpn"
|
71 |
},
|
@@ -80,7 +80,7 @@
|
|
80 |
},
|
81 |
{
|
82 |
"cell_type": "code",
|
83 |
-
"execution_count":
|
84 |
"metadata": {
|
85 |
"id": "_eEaJVxAKpV5"
|
86 |
},
|
@@ -133,7 +133,7 @@
|
|
133 |
},
|
134 |
{
|
135 |
"cell_type": "code",
|
136 |
-
"execution_count":
|
137 |
"metadata": {
|
138 |
"scrolled": true
|
139 |
},
|
@@ -150,10 +150,10 @@
|
|
150 |
"text/html": [
|
151 |
"\n",
|
152 |
" Tracking run with wandb version 0.10.33<br/>\n",
|
153 |
-
" Syncing run <strong style=\"color:#cdcd00\">
|
154 |
" Project page: <a href=\"https://wandb.ai/tmabraham/vqgan-jax\" target=\"_blank\">https://wandb.ai/tmabraham/vqgan-jax</a><br/>\n",
|
155 |
-
" Run page: <a href=\"https://wandb.ai/tmabraham/vqgan-jax/runs/
|
156 |
-
" Run data is saved locally in <code>/home/tmabraham/vqgan-jax/wandb/run-
|
157 |
" "
|
158 |
],
|
159 |
"text/plain": [
|
@@ -167,20 +167,20 @@
|
|
167 |
"name": "stderr",
|
168 |
"output_type": "stream",
|
169 |
"text": [
|
170 |
-
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact model-1ef8yxby:
|
171 |
]
|
172 |
}
|
173 |
],
|
174 |
"source": [
|
175 |
"import wandb\n",
|
176 |
"run = wandb.init()\n",
|
177 |
-
"artifact = run.use_artifact('wandb/hf-flax-dalle-mini/model-1ef8yxby:
|
178 |
"artifact_dir = artifact.download()"
|
179 |
]
|
180 |
},
|
181 |
{
|
182 |
"cell_type": "code",
|
183 |
-
"execution_count":
|
184 |
"metadata": {
|
185 |
"id": "_6-XKK40oEfP",
|
186 |
"scrolled": true
|
@@ -203,6 +203,15 @@
|
|
203 |
"model = CustomFlaxBartForConditionalGeneration.from_pretrained(artifact_dir)"
|
204 |
]
|
205 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
{
|
207 |
"cell_type": "code",
|
208 |
"execution_count": 8,
|
@@ -253,27 +262,57 @@
|
|
253 |
{
|
254 |
"cell_type": "code",
|
255 |
"execution_count": 10,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
256 |
"metadata": {
|
257 |
"id": "P32mJJSbrU1F"
|
258 |
},
|
259 |
"outputs": [],
|
260 |
"source": [
|
261 |
-
"input_ids_test = tokenizer
|
262 |
]
|
263 |
},
|
264 |
{
|
265 |
"cell_type": "code",
|
266 |
-
"execution_count":
|
267 |
"metadata": {},
|
268 |
"outputs": [
|
269 |
{
|
270 |
"data": {
|
271 |
"text/plain": [
|
272 |
-
"DeviceArray([[ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
273 |
-
" 2]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
]
|
275 |
},
|
276 |
-
"execution_count":
|
277 |
"metadata": {},
|
278 |
"output_type": "execute_result"
|
279 |
}
|
@@ -284,18 +323,38 @@
|
|
284 |
},
|
285 |
{
|
286 |
"cell_type": "code",
|
287 |
-
"execution_count":
|
288 |
"metadata": {
|
289 |
"id": "C7cHbIHruELT"
|
290 |
},
|
291 |
"outputs": [],
|
292 |
"source": [
|
293 |
-
"greedy_output = model.generate(input_ids_test, max_length=257)"
|
294 |
]
|
295 |
},
|
296 |
{
|
297 |
"cell_type": "code",
|
298 |
-
"execution_count":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
"metadata": {
|
300 |
"colab": {
|
301 |
"base_uri": "https://localhost:8080/"
|
@@ -307,42 +366,16 @@
|
|
307 |
{
|
308 |
"data": {
|
309 |
"text/plain": [
|
310 |
-
"DeviceArray([[16384,
|
311 |
-
"
|
312 |
-
"
|
313 |
-
"
|
314 |
-
"
|
315 |
-
"
|
316 |
-
"
|
317 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
318 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
319 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
320 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
321 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
322 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
323 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
324 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
325 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
326 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
327 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
328 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
329 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
330 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
331 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
332 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
333 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
334 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
335 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
336 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
337 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
338 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
339 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
340 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
341 |
-
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
342 |
-
" 10042]], dtype=int32)"
|
343 |
]
|
344 |
},
|
345 |
-
"execution_count":
|
346 |
"metadata": {},
|
347 |
"output_type": "execute_result"
|
348 |
}
|
@@ -351,6 +384,58 @@
|
|
351 |
"greedy_output[0]"
|
352 |
]
|
353 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
{
|
355 |
"cell_type": "markdown",
|
356 |
"metadata": {},
|
@@ -360,7 +445,7 @@
|
|
360 |
},
|
361 |
{
|
362 |
"cell_type": "code",
|
363 |
-
"execution_count":
|
364 |
"metadata": {},
|
365 |
"outputs": [],
|
366 |
"source": [
|
@@ -378,7 +463,7 @@
|
|
378 |
},
|
379 |
{
|
380 |
"cell_type": "code",
|
381 |
-
"execution_count":
|
382 |
"metadata": {},
|
383 |
"outputs": [],
|
384 |
"source": [
|
@@ -387,7 +472,7 @@
|
|
387 |
},
|
388 |
{
|
389 |
"cell_type": "code",
|
390 |
-
"execution_count":
|
391 |
"metadata": {},
|
392 |
"outputs": [],
|
393 |
"source": [
|
@@ -402,13 +487,14 @@
|
|
402 |
},
|
403 |
{
|
404 |
"cell_type": "code",
|
405 |
-
"execution_count":
|
406 |
"metadata": {
|
407 |
"colab": {
|
408 |
"base_uri": "https://localhost:8080/"
|
409 |
},
|
410 |
"id": "Jz032w73nHEf",
|
411 |
-
"outputId": "994d8e85-bff7-480b-8b69-f69dedc15c49"
|
|
|
412 |
},
|
413 |
"outputs": [
|
414 |
{
|
@@ -420,47 +506,49 @@
|
|
420 |
}
|
421 |
],
|
422 |
"source": [
|
423 |
-
"model = VQModel.from_pretrained(\"
|
424 |
]
|
425 |
},
|
426 |
{
|
427 |
"cell_type": "code",
|
428 |
-
"execution_count":
|
429 |
"metadata": {},
|
430 |
"outputs": [],
|
431 |
"source": [
|
432 |
"def get_images(indices, model):\n",
|
433 |
" indices = indices[:, 1:]\n",
|
434 |
-
"
|
435 |
-
"
|
|
|
436 |
]
|
437 |
},
|
438 |
{
|
439 |
"cell_type": "code",
|
440 |
-
"execution_count":
|
441 |
"metadata": {},
|
442 |
"outputs": [
|
443 |
{
|
444 |
"name": "stdout",
|
445 |
"output_type": "stream",
|
446 |
"text": [
|
|
|
447 |
"Working with z of shape (1, 256, 16, 16) = 65536 dimensions.\n"
|
448 |
]
|
449 |
},
|
450 |
{
|
451 |
"data": {
|
452 |
-
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAEACAIAAAD9XIvPAAAAF0lEQVR4nGP4//8/EwMDwygexaN45GEA7ucE/J1FRrMAAAAASUVORK5CYII=\n",
|
453 |
"text/plain": [
|
454 |
-
"<PIL.Image.Image image mode=RGB size=
|
455 |
]
|
456 |
},
|
457 |
-
"execution_count":
|
458 |
"metadata": {},
|
459 |
"output_type": "execute_result"
|
460 |
}
|
461 |
],
|
462 |
"source": [
|
463 |
-
"custom_to_pil(np.asarray(get_images(greedy_output[0], model)[0]))"
|
464 |
]
|
465 |
}
|
466 |
],
|
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
+
"execution_count": null,
|
15 |
"metadata": {
|
16 |
"colab": {
|
17 |
"base_uri": "https://localhost:8080/"
|
|
|
27 |
},
|
28 |
{
|
29 |
"cell_type": "code",
|
30 |
+
"execution_count": 1,
|
31 |
"metadata": {
|
32 |
"id": "M1wVkrpjU6zO"
|
33 |
},
|
|
|
39 |
},
|
40 |
{
|
41 |
"cell_type": "code",
|
42 |
+
"execution_count": 2,
|
43 |
"metadata": {},
|
44 |
"outputs": [
|
45 |
{
|
|
|
65 |
},
|
66 |
{
|
67 |
"cell_type": "code",
|
68 |
+
"execution_count": 3,
|
69 |
"metadata": {
|
70 |
"id": "9jQnM6S2vCpn"
|
71 |
},
|
|
|
80 |
},
|
81 |
{
|
82 |
"cell_type": "code",
|
83 |
+
"execution_count": 4,
|
84 |
"metadata": {
|
85 |
"id": "_eEaJVxAKpV5"
|
86 |
},
|
|
|
133 |
},
|
134 |
{
|
135 |
"cell_type": "code",
|
136 |
+
"execution_count": 5,
|
137 |
"metadata": {
|
138 |
"scrolled": true
|
139 |
},
|
|
|
150 |
"text/html": [
|
151 |
"\n",
|
152 |
" Tracking run with wandb version 0.10.33<br/>\n",
|
153 |
+
" Syncing run <strong style=\"color:#cdcd00\">rare-night-7</strong> to <a href=\"https://wandb.ai\" target=\"_blank\">Weights & Biases</a> <a href=\"https://docs.wandb.com/integrations/jupyter.html\" target=\"_blank\">(Documentation)</a>.<br/>\n",
|
154 |
" Project page: <a href=\"https://wandb.ai/tmabraham/vqgan-jax\" target=\"_blank\">https://wandb.ai/tmabraham/vqgan-jax</a><br/>\n",
|
155 |
+
" Run page: <a href=\"https://wandb.ai/tmabraham/vqgan-jax/runs/qzxavce8\" target=\"_blank\">https://wandb.ai/tmabraham/vqgan-jax/runs/qzxavce8</a><br/>\n",
|
156 |
+
" Run data is saved locally in <code>/home/tmabraham/vqgan-jax/wandb/run-20210715_075019-qzxavce8</code><br/><br/>\n",
|
157 |
" "
|
158 |
],
|
159 |
"text/plain": [
|
|
|
167 |
"name": "stderr",
|
168 |
"output_type": "stream",
|
169 |
"text": [
|
170 |
+
"\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact model-1ef8yxby:latest, 1674.97MB. 2 files... Done. 0:0:0\n"
|
171 |
]
|
172 |
}
|
173 |
],
|
174 |
"source": [
|
175 |
"import wandb\n",
|
176 |
"run = wandb.init()\n",
|
177 |
+
"artifact = run.use_artifact('wandb/hf-flax-dalle-mini/model-1ef8yxby:latest', type='bart_model')\n",
|
178 |
"artifact_dir = artifact.download()"
|
179 |
]
|
180 |
},
|
181 |
{
|
182 |
"cell_type": "code",
|
183 |
+
"execution_count": 6,
|
184 |
"metadata": {
|
185 |
"id": "_6-XKK40oEfP",
|
186 |
"scrolled": true
|
|
|
203 |
"model = CustomFlaxBartForConditionalGeneration.from_pretrained(artifact_dir)"
|
204 |
]
|
205 |
},
|
206 |
+
{
|
207 |
+
"cell_type": "code",
|
208 |
+
"execution_count": 7,
|
209 |
+
"metadata": {},
|
210 |
+
"outputs": [],
|
211 |
+
"source": [
|
212 |
+
"model.config.forced_bos_token_id = None"
|
213 |
+
]
|
214 |
+
},
|
215 |
{
|
216 |
"cell_type": "code",
|
217 |
"execution_count": 8,
|
|
|
262 |
{
|
263 |
"cell_type": "code",
|
264 |
"execution_count": 10,
|
265 |
+
"metadata": {},
|
266 |
+
"outputs": [],
|
267 |
+
"source": [
|
268 |
+
"input_text = ['I enjoy walking with my cute dog']*8"
|
269 |
+
]
|
270 |
+
},
|
271 |
+
{
|
272 |
+
"cell_type": "code",
|
273 |
+
"execution_count": 11,
|
274 |
"metadata": {
|
275 |
"id": "P32mJJSbrU1F"
|
276 |
},
|
277 |
"outputs": [],
|
278 |
"source": [
|
279 |
+
"input_ids_test = tokenizer(input_text, return_tensors='jax')"
|
280 |
]
|
281 |
},
|
282 |
{
|
283 |
"cell_type": "code",
|
284 |
+
"execution_count": 12,
|
285 |
"metadata": {},
|
286 |
"outputs": [
|
287 |
{
|
288 |
"data": {
|
289 |
"text/plain": [
|
290 |
+
"{'input_ids': DeviceArray([[ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
291 |
+
" 2],\n",
|
292 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
293 |
+
" 2],\n",
|
294 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
295 |
+
" 2],\n",
|
296 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
297 |
+
" 2],\n",
|
298 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
299 |
+
" 2],\n",
|
300 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
301 |
+
" 2],\n",
|
302 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
303 |
+
" 2],\n",
|
304 |
+
" [ 0, 100, 2254, 3051, 19, 127, 11962, 2335,\n",
|
305 |
+
" 2]], dtype=int32), 'attention_mask': DeviceArray([[1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
306 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
307 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
308 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
309 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
310 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
311 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1],\n",
|
312 |
+
" [1, 1, 1, 1, 1, 1, 1, 1, 1]], dtype=int32)}"
|
313 |
]
|
314 |
},
|
315 |
+
"execution_count": 12,
|
316 |
"metadata": {},
|
317 |
"output_type": "execute_result"
|
318 |
}
|
|
|
323 |
},
|
324 |
{
|
325 |
"cell_type": "code",
|
326 |
+
"execution_count": 13,
|
327 |
"metadata": {
|
328 |
"id": "C7cHbIHruELT"
|
329 |
},
|
330 |
"outputs": [],
|
331 |
"source": [
|
332 |
+
"greedy_output = model.generate(input_ids_test['input_ids'], max_length=257)"
|
333 |
]
|
334 |
},
|
335 |
{
|
336 |
"cell_type": "code",
|
337 |
+
"execution_count": 14,
|
338 |
+
"metadata": {},
|
339 |
+
"outputs": [
|
340 |
+
{
|
341 |
+
"data": {
|
342 |
+
"text/plain": [
|
343 |
+
"(8, 257)"
|
344 |
+
]
|
345 |
+
},
|
346 |
+
"execution_count": 14,
|
347 |
+
"metadata": {},
|
348 |
+
"output_type": "execute_result"
|
349 |
+
}
|
350 |
+
],
|
351 |
+
"source": [
|
352 |
+
"greedy_output[0].shape"
|
353 |
+
]
|
354 |
+
},
|
355 |
+
{
|
356 |
+
"cell_type": "code",
|
357 |
+
"execution_count": 15,
|
358 |
"metadata": {
|
359 |
"colab": {
|
360 |
"base_uri": "https://localhost:8080/"
|
|
|
366 |
{
|
367 |
"data": {
|
368 |
"text/plain": [
|
369 |
+
"DeviceArray([[16384, 10042, 10042, ..., 10042, 10042, 9570],\n",
|
370 |
+
" [16384, 10042, 10042, ..., 10042, 10042, 9570],\n",
|
371 |
+
" [16384, 10042, 10042, ..., 10042, 10042, 9570],\n",
|
372 |
+
" ...,\n",
|
373 |
+
" [16384, 10042, 10042, ..., 10042, 10042, 9570],\n",
|
374 |
+
" [16384, 10042, 10042, ..., 10042, 10042, 9570],\n",
|
375 |
+
" [16384, 10042, 10042, ..., 10042, 10042, 9570]], dtype=int32)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
376 |
]
|
377 |
},
|
378 |
+
"execution_count": 15,
|
379 |
"metadata": {},
|
380 |
"output_type": "execute_result"
|
381 |
}
|
|
|
384 |
"greedy_output[0]"
|
385 |
]
|
386 |
},
|
387 |
+
{
|
388 |
+
"cell_type": "code",
|
389 |
+
"execution_count": 16,
|
390 |
+
"metadata": {},
|
391 |
+
"outputs": [
|
392 |
+
{
|
393 |
+
"data": {
|
394 |
+
"text/plain": [
|
395 |
+
"DeviceArray([16384, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
396 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
397 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
398 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
399 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
400 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
401 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
402 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
403 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
404 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
405 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
406 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
407 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
408 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
409 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
410 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
411 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
412 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
413 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
414 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
415 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
416 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
417 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
418 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
419 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
420 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
421 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
422 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
423 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
424 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
425 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
426 |
+
" 10042, 10042, 10042, 10042, 10042, 10042, 10042, 10042,\n",
|
427 |
+
" 9570], dtype=int32)"
|
428 |
+
]
|
429 |
+
},
|
430 |
+
"execution_count": 16,
|
431 |
+
"metadata": {},
|
432 |
+
"output_type": "execute_result"
|
433 |
+
}
|
434 |
+
],
|
435 |
+
"source": [
|
436 |
+
"greedy_output[0][0]"
|
437 |
+
]
|
438 |
+
},
|
439 |
{
|
440 |
"cell_type": "markdown",
|
441 |
"metadata": {},
|
|
|
445 |
},
|
446 |
{
|
447 |
"cell_type": "code",
|
448 |
+
"execution_count": 17,
|
449 |
"metadata": {},
|
450 |
"outputs": [],
|
451 |
"source": [
|
|
|
463 |
},
|
464 |
{
|
465 |
"cell_type": "code",
|
466 |
+
"execution_count": 18,
|
467 |
"metadata": {},
|
468 |
"outputs": [],
|
469 |
"source": [
|
|
|
472 |
},
|
473 |
{
|
474 |
"cell_type": "code",
|
475 |
+
"execution_count": 19,
|
476 |
"metadata": {},
|
477 |
"outputs": [],
|
478 |
"source": [
|
|
|
487 |
},
|
488 |
{
|
489 |
"cell_type": "code",
|
490 |
+
"execution_count": 20,
|
491 |
"metadata": {
|
492 |
"colab": {
|
493 |
"base_uri": "https://localhost:8080/"
|
494 |
},
|
495 |
"id": "Jz032w73nHEf",
|
496 |
+
"outputId": "994d8e85-bff7-480b-8b69-f69dedc15c49",
|
497 |
+
"scrolled": true
|
498 |
},
|
499 |
"outputs": [
|
500 |
{
|
|
|
506 |
}
|
507 |
],
|
508 |
"source": [
|
509 |
+
"model = VQModel.from_pretrained(\"flax-community/vqgan_f16_16384\")"
|
510 |
]
|
511 |
},
|
512 |
{
|
513 |
"cell_type": "code",
|
514 |
+
"execution_count": 21,
|
515 |
"metadata": {},
|
516 |
"outputs": [],
|
517 |
"source": [
|
518 |
"def get_images(indices, model):\n",
|
519 |
" indices = indices[:, 1:]\n",
|
520 |
+
" print(indices.shape)\n",
|
521 |
+
" img = model.decode_code(indices)\n",
|
522 |
+
" return img"
|
523 |
]
|
524 |
},
|
525 |
{
|
526 |
"cell_type": "code",
|
527 |
+
"execution_count": 22,
|
528 |
"metadata": {},
|
529 |
"outputs": [
|
530 |
{
|
531 |
"name": "stdout",
|
532 |
"output_type": "stream",
|
533 |
"text": [
|
534 |
+
"(1, 256)\n",
|
535 |
"Working with z of shape (1, 256, 16, 16) = 65536 dimensions.\n"
|
536 |
]
|
537 |
},
|
538 |
{
|
539 |
"data": {
|
540 |
+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAtSEl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f4AZ/B/oGCPDHz/D1O/z6T/DtBvcv8EaA75NZZEfC91zgAv7FtZCdkpxrr9dD1QYrPbX1deLwIjHfxyCuR9Kfpxh1NM3uECDgHd4+4GMAeiccEG4//+d//+U//v3Pv3zHb3/72+9/fPvhh/sbfvz6Tl//8eXXjx//9NP7HwBfBrrDgISICESjIMAcV2QTCHqrp4P4u/z7kQr9y4wepVqFmpmL5hcHw+JEy6SwkCB5SjGOJpjOU+t/YK5BRNjyLbTOHDfFJSPjpZQAldWn0GXetjsQIiAMBDQQwv2dAD8A8OPtDd7ubx/w/1lcuBBroJa/AAAAAElFTkSuQmCC\n",
|
541 |
"text/plain": [
|
542 |
+
"<PIL.Image.Image image mode=RGB size=256x256 at 0x7FA20677A400>"
|
543 |
]
|
544 |
},
|
545 |
+
"execution_count": 22,
|
546 |
"metadata": {},
|
547 |
"output_type": "execute_result"
|
548 |
}
|
549 |
],
|
550 |
"source": [
|
551 |
+
"custom_to_pil(np.asarray(get_images(jnp.expand_dims(greedy_output[0][0],0), model)[0]))"
|
552 |
]
|
553 |
}
|
554 |
],
|