feiyang-cai commited on
Commit
9e676a7
·
1 Parent(s): d84b0a6

link to gpu model

Browse files
Files changed (3) hide show
  1. .gitignore +2 -0
  2. app.py +1 -1
  3. utils.py +0 -1
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ env/*
2
+ __pycache__/*
app.py CHANGED
@@ -49,7 +49,6 @@ def predict_single_label(smiles, property_name):
49
  return "NA", running_status
50
 
51
  #prediction = model.predict(smiles, property_name, adapter_id)
52
- print("hello4")
53
  prediction = model.predict_single_smiles(smiles, dataset_task_types[property_id])
54
  if prediction is None:
55
  return "NA", "Invalid SMILES string"
@@ -165,6 +164,7 @@ def build_inference():
165
  #with gr.Row():
166
  print(property_names[0].lower())
167
  print(properties)
 
168
  dropdown = gr.Dropdown(properties, label="Property", value=dataset_property_names[property_names[0].lower()])
169
  description_box = gr.Textbox(label="Property description", lines=5,
170
  interactive=False,
 
49
  return "NA", running_status
50
 
51
  #prediction = model.predict(smiles, property_name, adapter_id)
 
52
  prediction = model.predict_single_smiles(smiles, dataset_task_types[property_id])
53
  if prediction is None:
54
  return "NA", "Invalid SMILES string"
 
164
  #with gr.Row():
165
  print(property_names[0].lower())
166
  print(properties)
167
+ gr.Markdown(f"<span style='color: red;'>This space runs on a CPU, so predictions may take over 20 seconds. For faster performance, you can use the </span> <a href='https://huggingface.co/spaces/ChemFM/molecular_property_prediction_zero_gpu'>GPU-powered space</a>.")
168
  dropdown = gr.Dropdown(properties, label="Property", value=dataset_property_names[property_names[0].lower()])
169
  description_box = gr.Textbox(label="Property description", lines=5,
170
  interactive=False,
utils.py CHANGED
@@ -266,7 +266,6 @@ class MolecularPropertyPredictionModel():
266
  # handle error
267
  return "error"
268
 
269
- @spaces.GPU(duration=20)
270
  def predict(self, valid_df, task_type):
271
 
272
  with calculateDuration("predicting"):
 
266
  # handle error
267
  return "error"
268
 
 
269
  def predict(self, valid_df, task_type):
270
 
271
  with calculateDuration("predicting"):