Spaces:
Sleeping
Sleeping
Improved Instructions
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ from model import load_model
|
|
13 |
from utils import smiles_to_data
|
14 |
|
15 |
# Config
|
16 |
-
DEVICE, RDKIT_DIM, MODEL_PATH, MAX_DISPLAY = "cpu", 6, "best_hybridgnn.pt",
|
17 |
|
18 |
# Model & DB (cached)
|
19 |
@st.cache_resource
|
@@ -53,11 +53,11 @@ st.markdown("""
|
|
53 |
This app predicts the HOMO-LUMO energy gap for molecules using a trained Graph Neural Network (GNN).
|
54 |
|
55 |
**Instructions:**
|
56 |
-
- Enter a **single SMILES** string or **comma
|
57 |
- Or **upload a CSV file** containing a single column of SMILES strings.
|
58 |
- **Note**: If you've uploaded a CSV and want to switch to typing SMILES, please click the "X" next to the uploaded file to clear it.
|
59 |
-
- SMILES format should look like: `
|
60 |
-
- The app will display predictions and molecule images (up to
|
61 |
""")
|
62 |
|
63 |
# File uploader (outside form)
|
@@ -110,7 +110,7 @@ if smiles_list:
|
|
110 |
st.subheader(f"Results (first {MAX_DISPLAY})")
|
111 |
for i, (smi, pred) in enumerate(zip(vsmi, preds)):
|
112 |
if i >= MAX_DISPLAY:
|
113 |
-
st.info("
|
114 |
break
|
115 |
mol = Chem.MolFromSmiles(smi)
|
116 |
if mol:
|
|
|
13 |
from utils import smiles_to_data
|
14 |
|
15 |
# Config
|
16 |
+
DEVICE, RDKIT_DIM, MODEL_PATH, MAX_DISPLAY = "cpu", 6, "best_hybridgnn.pt", 20
|
17 |
|
18 |
# Model & DB (cached)
|
19 |
@st.cache_resource
|
|
|
53 |
This app predicts the HOMO-LUMO energy gap for molecules using a trained Graph Neural Network (GNN).
|
54 |
|
55 |
**Instructions:**
|
56 |
+
- Enter a **single SMILES** string or **comma/newline separated list** in the box below.
|
57 |
- Or **upload a CSV file** containing a single column of SMILES strings.
|
58 |
- **Note**: If you've uploaded a CSV and want to switch to typing SMILES, please click the "X" next to the uploaded file to clear it.
|
59 |
+
- SMILES format should look like: `O=C(C)Oc1ccccc1C(=O)O` (for aspirin).
|
60 |
+
- The app will display predictions and molecule images (up to 20 shown at once).
|
61 |
""")
|
62 |
|
63 |
# File uploader (outside form)
|
|
|
110 |
st.subheader(f"Results (first {MAX_DISPLAY})")
|
111 |
for i, (smi, pred) in enumerate(zip(vsmi, preds)):
|
112 |
if i >= MAX_DISPLAY:
|
113 |
+
st.info("...Only Displaying 20 Compounds")
|
114 |
break
|
115 |
mol = Chem.MolFromSmiles(smi)
|
116 |
if mol:
|