Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
7e71eb2e
Unverified
Commit
7e71eb2e
authored
Jun 19, 2023
by
amyeroberts
Committed by
GitHub
Jun 19, 2023
Browse files
Fix ImageGPT doctest (#24353)
Fix doctest
parent
a4de24f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/models/imagegpt/modeling_imagegpt.py
src/transformers/models/imagegpt/modeling_imagegpt.py
+2
-2
No files found.
src/transformers/models/imagegpt/modeling_imagegpt.py
View file @
7e71eb2e
...
@@ -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)
```"""
```"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment