bilalEthizo commited on
Commit
66f4bbf
·
verified ·
1 Parent(s): 63d4b3c

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,7 +67,7 @@ class DocumentClassifierCNN(nn.Module):
67
 
68
  def load_model():
69
  model = DocumentClassifierCNN()
70
- ckpt = torch.load("best_model.pth", map_location="cpu", weights_only=True)
71
  model.load_state_dict(ckpt["model_state_dict"])
72
  model.eval()
73
  return model
@@ -222,4 +222,4 @@ demo = gr.Interface(
222
  )
223
 
224
  if __name__ == "__main__":
225
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
67
 
68
  def load_model():
69
  model = DocumentClassifierCNN()
70
+ ckpt = torch.load("best_model.pth", map_location="cpu", weights_only=False)
71
  model.load_state_dict(ckpt["model_state_dict"])
72
  model.eval()
73
  return model
 
222
  )
223
 
224
  if __name__ == "__main__":
225
+ demo.launch(server_name="0.0.0.0", server_port=7860, show_error=True)