Spaces:
Sleeping
Sleeping
Upload app.py with huggingface_hub
Browse files
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=
|
| 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)
|