Update app.py
Browse files
app.py
CHANGED
|
@@ -6,12 +6,13 @@ device=torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
| 6 |
|
| 7 |
|
| 8 |
# Cargamos el learner
|
| 9 |
-
def load(map_location='cpu', pickle_module=pickle, **pickle_load_args):
|
| 10 |
-
with open ('modelomemes.pkl',mode='rb') as file:
|
| 11 |
-
learn=torch.load(cloudpickle.load(file), map_location="cpu")
|
| 12 |
|
| 13 |
-
|
| 14 |
-
load()
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|
|
|
|
| 6 |
|
| 7 |
|
| 8 |
# Cargamos el learner
|
| 9 |
+
#def load(map_location='cpu', pickle_module=pickle, **pickle_load_args):
|
| 10 |
+
# with open ('modelomemes.pkl',mode='rb') as file:
|
| 11 |
+
# learn=torch.load(cloudpickle.load(file), map_location="cpu")
|
| 12 |
|
| 13 |
+
learn = Net()
|
| 14 |
+
learn.load_state_dict(torch.load(weights_paths, map_location=device))
|
| 15 |
+
learn.to(device)
|
| 16 |
|
| 17 |
|
| 18 |
# Definimos una función que se encarga de llevar a cabo las predicciones
|