Update app.py
Browse files
app.py
CHANGED
|
@@ -14,14 +14,7 @@ from torch import autocast
|
|
| 14 |
from torchvision import transforms as tfms
|
| 15 |
from tqdm.auto import tqdm
|
| 16 |
from transformers import CLIPTextModel, CLIPTokenizer, logging
|
| 17 |
-
import os
|
| 18 |
-
import os
|
| 19 |
-
# os.environ['HF_HOME'] = '/raid/users/mohammadibrahim-st/ModelCache'
|
| 20 |
-
torch.manual_seed(1)
|
| 21 |
-
if not (Path.home()/'.cache/huggingface'/'token').exists(): notebook_login()
|
| 22 |
|
| 23 |
-
# Supress some unnecessary warnings when loading the CLIPTextModel
|
| 24 |
-
logging.set_verbosity_error()
|
| 25 |
|
| 26 |
# Set device
|
| 27 |
torch_device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
|
|
|
|
| 14 |
from torchvision import transforms as tfms
|
| 15 |
from tqdm.auto import tqdm
|
| 16 |
from transformers import CLIPTextModel, CLIPTokenizer, logging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
|
|
|
|
|
|
| 18 |
|
| 19 |
# Set device
|
| 20 |
torch_device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
|