bshor commited on
Commit
383e4c1
·
1 Parent(s): 0fdcb79

add support in app

Browse files
Files changed (2) hide show
  1. env_consts.py +3 -0
  2. inference_app.py +8 -3
env_consts.py CHANGED
@@ -4,3 +4,6 @@ TEST_INPUT_DIR = None
4
  TEST_OUTPUT_DIR = None
5
  THIS_FILE_DIR = os.path.dirname(os.path.abspath(__file__))
6
  CKPT_PATH = os.path.join(THIS_FILE_DIR, "resources", "77-182500_only_weights.ckpt")
 
 
 
 
4
  TEST_OUTPUT_DIR = None
5
  THIS_FILE_DIR = os.path.dirname(os.path.abspath(__file__))
6
  CKPT_PATH = os.path.join(THIS_FILE_DIR, "resources", "77-182500_only_weights.ckpt")
7
+ RUN_CONFIG_PATH = os.path.join(THIS_FILE_DIR, "resources", "run_config.json")
8
+
9
+ OUTPUT_PATH = os.path.join(THIS_FILE_DIR, "predicted_out.pdb")
inference_app.py CHANGED
@@ -5,7 +5,8 @@ import json
5
  import gradio as gr
6
 
7
  from gradio_molecule3d import Molecule3D
8
-
 
9
 
10
 
11
 
@@ -14,10 +15,14 @@ def predict (input_seq_1, input_msa_1, input_protein_1, input_seq_2,input_msa_2,
14
  # Do inference here
15
  # return an output pdb file with the protein and two chains A and B.
16
  # also return a JSON with any metrics you want to report
17
- metrics = {"mean_plddt": 80, "binding_affinity": 2}
 
 
 
18
  end_time = time.time()
19
  run_time = end_time - start_time
20
- return "test_out.pdb",json.dumps(metrics), run_time
 
21
 
22
  with gr.Blocks() as app:
23
 
 
5
  import gradio as gr
6
 
7
  from gradio_molecule3d import Molecule3D
8
+ from run_on_seq import run_on_sample_seqs
9
+ from env_consts import RUN_CONFIG_PATH, OUTPUT_PATH
10
 
11
 
12
 
 
15
  # Do inference here
16
  # return an output pdb file with the protein and two chains A and B.
17
  # also return a JSON with any metrics you want to report
18
+ # metrics = {"mean_plddt": 80, "binding_affinity": 2}
19
+ metrics = {}
20
+ run_on_sample_seqs(input_seq_1, input_protein_1, input_seq_2, input_protein_2, OUTPUT_PATH, RUN_CONFIG_PATH)
21
+
22
  end_time = time.time()
23
  run_time = end_time - start_time
24
+
25
+ return OUTPUT_PATH, json.dumps(metrics), run_time
26
 
27
  with gr.Blocks() as app:
28