mirror of
https://github.com/huggingface/transformers.git
synced 2025-08-01 18:51:14 +06:00
parent
a4de24f691
commit
7e71eb2ef7
@ -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):
|
|||||||
... ] # 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)
|
||||||
```"""
|
```"""
|
||||||
|
Loading…
Reference in New Issue
Block a user