Update server.py
Browse files
server.py
CHANGED
|
@@ -7,15 +7,6 @@ import os
|
|
| 7 |
from PIL import Image
|
| 8 |
from transformers import CLIPProcessor, CLIPModel
|
| 9 |
import numpy as np
|
| 10 |
-
import shutil
|
| 11 |
-
import os
|
| 12 |
-
from transformers import CLIPProcessor, CLIPModel
|
| 13 |
-
|
| 14 |
-
# Clear the cache before loading the model
|
| 15 |
-
cache_dir = os.path.expanduser("~/.cache/huggingface")
|
| 16 |
-
if os.path.exists(cache_dir):
|
| 17 |
-
shutil.rmtree(cache_dir)
|
| 18 |
-
print("Cache cleared.")
|
| 19 |
|
| 20 |
# Define the MIDM model
|
| 21 |
class MIDM(nn.Module):
|
|
|
|
| 7 |
from PIL import Image
|
| 8 |
from transformers import CLIPProcessor, CLIPModel
|
| 9 |
import numpy as np
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Define the MIDM model
|
| 12 |
class MIDM(nn.Module):
|