Fix ImageGPT doctest (#24353)

Fix doctest
This commit is contained in:
amyeroberts 2023-06-19 15:23:29 +01:00 committed by GitHub
parent a4de24f691
commit 7e71eb2ef7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -980,7 +980,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel):
>>> image_processor = AutoImageProcessor.from_pretrained("openai/imagegpt-small")
>>> model = ImageGPTForCausalImageModeling.from_pretrained("openai/imagegpt-small")
>>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
>>> model.to(device)
>>> model.to(device) # doctest: +IGNORE_RESULT
>>> # unconditional generation of 8 images
>>> batch_size = 4
@ -1000,7 +1000,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel):
... ] # convert color cluster tokens back to pixels
>>> f, axes = plt.subplots(1, batch_size, dpi=300)
>>> for img, ax in zip(samples_img, axes):
>>> for img, ax in zip(samples_img, axes): # doctest: +IGNORE_RESULT
... ax.axis("off")
... ax.imshow(img)
```"""