Unverified Commit 7e71eb2e authored by amyeroberts's avatar amyeroberts Committed by GitHub
Browse files

Fix ImageGPT doctest (#24353)

Fix doctest
parent a4de24f6
...@@ -980,7 +980,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel): ...@@ -980,7 +980,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel):
>>> image_processor = AutoImageProcessor.from_pretrained("openai/imagegpt-small") >>> image_processor = AutoImageProcessor.from_pretrained("openai/imagegpt-small")
>>> model = ImageGPTForCausalImageModeling.from_pretrained("openai/imagegpt-small") >>> model = ImageGPTForCausalImageModeling.from_pretrained("openai/imagegpt-small")
>>> device = torch.device("cuda" if torch.cuda.is_available() else "cpu") >>> 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 >>> # unconditional generation of 8 images
>>> batch_size = 4 >>> batch_size = 4
...@@ -1000,7 +1000,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel): ...@@ -1000,7 +1000,7 @@ class ImageGPTForCausalImageModeling(ImageGPTPreTrainedModel):
... ] # convert color cluster tokens back to pixels ... ] # convert color cluster tokens back to pixels
>>> f, axes = plt.subplots(1, batch_size, dpi=300) >>> 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.axis("off")
... ax.imshow(img) ... ax.imshow(img)
```""" ```"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment