Spaces:
Running
Running
app fixes_v2
Browse files
app.py
CHANGED
@@ -124,13 +124,14 @@ def forward(self,
|
|
124 |
def load_model(test=False):
|
125 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
126 |
try:
|
127 |
-
path = '
|
128 |
with open(f'{path}/label_to_theme.json', 'r') as f:
|
129 |
label_to_theme = json.load(f)
|
130 |
except:
|
131 |
-
path = '
|
132 |
with open(f'{path}/label_to_theme.json', 'r') as f:
|
133 |
label_to_theme = json.load(f)
|
|
|
134 |
|
135 |
class_weights = torch.load(f'{path}/class_weights.pth').to(device)
|
136 |
|
|
|
124 |
def load_model(test=False):
|
125 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
126 |
try:
|
127 |
+
path = '/Users/bvd757/my_documents/Машинное обучение 2/Howework4'
|
128 |
with open(f'{path}/label_to_theme.json', 'r') as f:
|
129 |
label_to_theme = json.load(f)
|
130 |
except:
|
131 |
+
path = ''
|
132 |
with open(f'{path}/label_to_theme.json', 'r') as f:
|
133 |
label_to_theme = json.load(f)
|
134 |
+
|
135 |
|
136 |
class_weights = torch.load(f'{path}/class_weights.pth').to(device)
|
137 |
|