Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
ac9d211
1
Parent(s):
5701dad
update
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ from huggingface_hub import HfApi, get_collection, list_collections
|
|
3 |
from utils import MolecularPropertyPredictionModel, dataset_task_types, dataset_descriptions, dataset_property_names, dataset_property_names_to_dataset
|
4 |
import pandas as pd
|
5 |
import os
|
|
|
6 |
|
7 |
def get_models():
|
8 |
# this is the collection id for the molecular property prediction models
|
@@ -26,6 +27,7 @@ def get_description(property_name):
|
|
26 |
property_id = dataset_property_names_to_dataset[property_name]
|
27 |
return dataset_descriptions[property_id]
|
28 |
|
|
|
29 |
def predict_single_label(smiles, property_name):
|
30 |
property_id = dataset_property_names_to_dataset[property_name]
|
31 |
|
|
|
3 |
from utils import MolecularPropertyPredictionModel, dataset_task_types, dataset_descriptions, dataset_property_names, dataset_property_names_to_dataset
|
4 |
import pandas as pd
|
5 |
import os
|
6 |
+
import spaces
|
7 |
|
8 |
def get_models():
|
9 |
# this is the collection id for the molecular property prediction models
|
|
|
27 |
property_id = dataset_property_names_to_dataset[property_name]
|
28 |
return dataset_descriptions[property_id]
|
29 |
|
30 |
+
@spaces.GPU(duration=20)
|
31 |
def predict_single_label(smiles, property_name):
|
32 |
property_id = dataset_property_names_to_dataset[property_name]
|
33 |
|
utils.py
CHANGED
@@ -266,7 +266,7 @@ class MolecularPropertyPredictionModel():
|
|
266 |
# handle error
|
267 |
return "error"
|
268 |
|
269 |
-
|
270 |
def predict(self, valid_df, task_type):
|
271 |
|
272 |
with calculateDuration("predicting"):
|
|
|
266 |
# handle error
|
267 |
return "error"
|
268 |
|
269 |
+
|
270 |
def predict(self, valid_df, task_type):
|
271 |
|
272 |
with calculateDuration("predicting"):
|