Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
| 2 |
from trainer import Trainer
|
| 3 |
import random
|
| 4 |
from rdkit.Chem import Draw
|
|
@@ -118,8 +120,9 @@ with st.sidebar:
|
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
-
if submitted
|
| 122 |
-
|
|
|
|
| 123 |
config = model_configs[model_name]
|
| 124 |
|
| 125 |
config.inference_sample_num = molecule_num_input
|
|
@@ -139,7 +142,8 @@ if submitted or ("submitted" in st.session_state):
|
|
| 139 |
|
| 140 |
with open(f'experiments/inference/{model_name}/inference_drugs.txt') as f:
|
| 141 |
inference_drugs = f.read()
|
| 142 |
-
st.download_button(label="Click to download generated molecules", data=inference_drugs, file_name=f'DrugGEN-{model_name}_denovo_mols.smi', mime="text/plain")
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
st.write("Structures of randomly selected 12 de novo molecules from the inference set:")
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import streamlit_ext as ste
|
| 3 |
+
|
| 4 |
from trainer import Trainer
|
| 5 |
import random
|
| 6 |
from rdkit.Chem import Draw
|
|
|
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
+
if submitted:
|
| 124 |
+
# if submitted or ("submitted" in st.session_state):
|
| 125 |
+
# st.session_state["submitted"] = True
|
| 126 |
config = model_configs[model_name]
|
| 127 |
|
| 128 |
config.inference_sample_num = molecule_num_input
|
|
|
|
| 142 |
|
| 143 |
with open(f'experiments/inference/{model_name}/inference_drugs.txt') as f:
|
| 144 |
inference_drugs = f.read()
|
| 145 |
+
# st.download_button(label="Click to download generated molecules", data=inference_drugs, file_name=f'DrugGEN-{model_name}_denovo_mols.smi', mime="text/plain")
|
| 146 |
+
ste.download_button(label="Click to download generated molecules", data=inference_drugs, file_name=f'DrugGEN-{model_name}_denovo_mols.smi', mime="text/plain")
|
| 147 |
|
| 148 |
|
| 149 |
st.write("Structures of randomly selected 12 de novo molecules from the inference set:")
|