Update app.py
Browse files
app.py
CHANGED
@@ -100,6 +100,7 @@ def create_demo():
|
|
100 |
|
101 |
|
102 |
if __name__ == "__main__":
|
|
|
103 |
model = Mamba(num_layers = 2, d_input = 1024, d_model = 512, num_classes=7, model_name='jina', pooling=None).to(device)
|
104 |
checkpoint = torch.load("Mamba_jina_checkpoint.pth", map_location=torch.device('cpu'))
|
105 |
model.load_state_dict(checkpoint['model_state_dict'])
|
|
|
100 |
|
101 |
|
102 |
if __name__ == "__main__":
|
103 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
104 |
model = Mamba(num_layers = 2, d_input = 1024, d_model = 512, num_classes=7, model_name='jina', pooling=None).to(device)
|
105 |
checkpoint = torch.load("Mamba_jina_checkpoint.pth", map_location=torch.device('cpu'))
|
106 |
model.load_state_dict(checkpoint['model_state_dict'])
|