Update app.py
Browse files
app.py
CHANGED
@@ -14,18 +14,6 @@ import csv
|
|
14 |
from datetime import datetime
|
15 |
import json
|
16 |
|
17 |
-
|
18 |
-
zero = torch.tensor([0]).cuda()
|
19 |
-
one = torch.tensor([0]).cuda()
|
20 |
-
two = torch.tensor([0]).cuda()
|
21 |
-
|
22 |
-
@spaces.GPU
|
23 |
-
def test(n):
|
24 |
-
print('in', zero.device, one.device, two.device)
|
25 |
-
return 0
|
26 |
-
|
27 |
-
test(1)
|
28 |
-
|
29 |
from rdkit import Chem
|
30 |
from rdkit.Chem import Draw
|
31 |
|
@@ -65,6 +53,7 @@ atexit.register(cleanup_temp_files)
|
|
65 |
def random_properties():
|
66 |
return known_labels[all_properties].sample(1).values.tolist()[0]
|
67 |
|
|
|
68 |
def load_model(model_choice):
|
69 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
70 |
model = load_graph_decoder(path=model_choice)
|
|
|
14 |
from datetime import datetime
|
15 |
import json
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
from rdkit import Chem
|
18 |
from rdkit.Chem import Draw
|
19 |
|
|
|
53 |
def random_properties():
|
54 |
return known_labels[all_properties].sample(1).values.tolist()[0]
|
55 |
|
56 |
+
@spaces.GPU
|
57 |
def load_model(model_choice):
|
58 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
59 |
model = load_graph_decoder(path=model_choice)
|