Spaces:
Runtime error
Runtime error
style: format
Browse files- textual_inversion.py +2 -4
textual_inversion.py
CHANGED
@@ -7,12 +7,10 @@ from pathlib import Path
|
|
7 |
from typing import Optional
|
8 |
|
9 |
import numpy as np
|
|
|
10 |
import torch
|
11 |
import torch.nn.functional as F
|
12 |
import torch.utils.checkpoint
|
13 |
-
from torch.utils.data import Dataset
|
14 |
-
|
15 |
-
import PIL
|
16 |
from accelerate import Accelerator
|
17 |
from accelerate.logging import get_logger
|
18 |
from accelerate.utils import set_seed
|
@@ -32,11 +30,11 @@ from huggingface_hub import HfFolder, Repository, whoami
|
|
32 |
# TODO: remove and import from diffusers.utils when the new version of diffusers is released
|
33 |
from packaging import version
|
34 |
from PIL import Image
|
|
|
35 |
from torchvision import transforms
|
36 |
from tqdm.auto import tqdm
|
37 |
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
38 |
|
39 |
-
|
40 |
if version.parse(version.parse(PIL.__version__).base_version) >= version.parse("9.1.0"):
|
41 |
PIL_INTERPOLATION = {
|
42 |
"linear": PIL.Image.Resampling.BILINEAR,
|
|
|
7 |
from typing import Optional
|
8 |
|
9 |
import numpy as np
|
10 |
+
import PIL
|
11 |
import torch
|
12 |
import torch.nn.functional as F
|
13 |
import torch.utils.checkpoint
|
|
|
|
|
|
|
14 |
from accelerate import Accelerator
|
15 |
from accelerate.logging import get_logger
|
16 |
from accelerate.utils import set_seed
|
|
|
30 |
# TODO: remove and import from diffusers.utils when the new version of diffusers is released
|
31 |
from packaging import version
|
32 |
from PIL import Image
|
33 |
+
from torch.utils.data import Dataset
|
34 |
from torchvision import transforms
|
35 |
from tqdm.auto import tqdm
|
36 |
from transformers import CLIPFeatureExtractor, CLIPTextModel, CLIPTokenizer
|
37 |
|
|
|
38 |
if version.parse(version.parse(PIL.__version__).base_version) >= version.parse("9.1.0"):
|
39 |
PIL_INTERPOLATION = {
|
40 |
"linear": PIL.Image.Resampling.BILINEAR,
|