Spaces:
Sleeping
Sleeping
Muhammad Naufal Rizqullah
commited on
Commit
·
91d6eae
1
Parent(s):
df3f4c0
feat: :zap: fix solution 2 part 1
Browse files- utils/model.py +4 -1
utils/model.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import torchvision
|
2 |
import torch
|
3 |
import functools
|
|
|
4 |
|
5 |
from torch import nn
|
6 |
from pathlib import Path
|
@@ -21,7 +22,9 @@ def create_effnetb2_model(num_class: int):
|
|
21 |
"""
|
22 |
|
23 |
# Change path for storing cache.
|
24 |
-
|
|
|
|
|
25 |
torch.hub.set_dir(path_dir_cache)
|
26 |
print(f"[DEBUG] Change Storing Cache in directory: {path_dir_cache}")
|
27 |
|
|
|
1 |
import torchvision
|
2 |
import torch
|
3 |
import functools
|
4 |
+
import os
|
5 |
|
6 |
from torch import nn
|
7 |
from pathlib import Path
|
|
|
22 |
"""
|
23 |
|
24 |
# Change path for storing cache.
|
25 |
+
DIR_PATH = os.path.dirname(os.path.abspath(__file__))
|
26 |
+
print(f"[INFO] The path is {DIR_PATH}")
|
27 |
+
path_dir_cache = Path(f"{DIR_PATH}/.cache")
|
28 |
torch.hub.set_dir(path_dir_cache)
|
29 |
print(f"[DEBUG] Change Storing Cache in directory: {path_dir_cache}")
|
30 |
|