mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
parent
a4de24f691
commit
7e71eb2ef7
@ -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)
|
||||
```"""
|
||||
|
Loading…
Reference in New Issue
Block a user