Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from trainer import Trainer
|
|
|
3 |
|
4 |
class DrugGENConfig:
|
5 |
submodel='CrossLoss'
|
@@ -56,7 +57,7 @@ class DrugGENConfig:
|
|
56 |
inf_raw_file='data/chembl_test.smi'
|
57 |
inf_drug_raw_file="data/akt_test.smi"
|
58 |
log_sample_step=1000
|
59 |
-
set_seed=
|
60 |
seed=1
|
61 |
resume=False
|
62 |
resume_epoch=None
|
@@ -94,8 +95,10 @@ with st.sidebar:
|
|
94 |
"Select a model to make inference",
|
95 |
('Prot', 'CrossLoss', 'NoTarget'))
|
96 |
|
97 |
-
|
98 |
|
|
|
|
|
99 |
submitted = st.form_submit_button("Start Computing")
|
100 |
|
101 |
|
@@ -103,7 +106,8 @@ if submitted:
|
|
103 |
|
104 |
config = model_configs[model_name]
|
105 |
|
106 |
-
config.inference_sample_num =
|
|
|
107 |
|
108 |
with st.spinner(f'Creating the trainer class instance for {model_name}...'):
|
109 |
trainer = Trainer(config)
|
|
|
1 |
import streamlit as st
|
2 |
from trainer import Trainer
|
3 |
+
import random
|
4 |
|
5 |
class DrugGENConfig:
|
6 |
submodel='CrossLoss'
|
|
|
57 |
inf_raw_file='data/chembl_test.smi'
|
58 |
inf_drug_raw_file="data/akt_test.smi"
|
59 |
log_sample_step=1000
|
60 |
+
set_seed=True
|
61 |
seed=1
|
62 |
resume=False
|
63 |
resume_epoch=None
|
|
|
95 |
"Select a model to make inference",
|
96 |
('Prot', 'CrossLoss', 'NoTarget'))
|
97 |
|
98 |
+
molecule_num_input = st.number_input('Number of molecules to generate', min_value=1, max_value=100_000, value=1000, step=1)
|
99 |
|
100 |
+
seed_input = st.number_input("Input a seed for reproducibiliy", min_value=0, value=random.randint(1, 1000), step=1)
|
101 |
+
|
102 |
submitted = st.form_submit_button("Start Computing")
|
103 |
|
104 |
|
|
|
106 |
|
107 |
config = model_configs[model_name]
|
108 |
|
109 |
+
config.inference_sample_num = molecule_num_input
|
110 |
+
config.seed = seed_input
|
111 |
|
112 |
with st.spinner(f'Creating the trainer class instance for {model_name}...'):
|
113 |
trainer = Trainer(config)
|