joros244 commited on
Commit
1ecc26f
·
1 Parent(s): ad109e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -6,14 +6,11 @@ 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
- learn = Net()
14
- learn.load_state_dict(torch.load('./ElModeloMemes.pth', map_location=device))
15
- learn.to(device)
16
-
17
 
18
  # Definimos una función que se encarga de llevar a cabo las predicciones
19
  def predict(img):
 
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
+ load()
 
 
 
14
 
15
  # Definimos una función que se encarga de llevar a cabo las predicciones
16
  def predict(img):