Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,16 +35,52 @@ st.caption(
|
|
| 35 |
"Predict reaction products, reactants, or yields from your inputs using a pretrained ReactionT5 model."
|
| 36 |
)
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
with st.expander("How to format your CSV", expanded=False):
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
| 42 |
- Optional columns: `REAGENT`, `SOLVENT`, `CATALYST`.
|
| 43 |
- If a field lists multiple compounds, separate them with a dot (`.`).
|
| 44 |
-
- For details, download **demo_reaction_data.csv** and check its contents.
|
| 45 |
-
- Output contains predicted product SMILES and the sum of log-likelihoods for each prediction,
|
|
|
|
| 46 |
"""
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# ------------------------------
|
| 50 |
# Demo data download
|
|
@@ -81,14 +117,6 @@ st.divider()
|
|
| 81 |
# ------------------------------
|
| 82 |
with st.sidebar:
|
| 83 |
st.header("Configuration")
|
| 84 |
-
|
| 85 |
-
task = st.selectbox(
|
| 86 |
-
"Task",
|
| 87 |
-
options=["product prediction", "retrosynthesis prediction", "yield prediction"],
|
| 88 |
-
index=0,
|
| 89 |
-
help="Choose the task to run.",
|
| 90 |
-
)
|
| 91 |
-
|
| 92 |
# Model options tied to task
|
| 93 |
if task == "product prediction":
|
| 94 |
model_options = [
|
|
|
|
| 35 |
"Predict reaction products, reactants, or yields from your inputs using a pretrained ReactionT5 model."
|
| 36 |
)
|
| 37 |
|
| 38 |
+
# ------------------------------
|
| 39 |
+
# Sidebar: configuration
|
| 40 |
+
# ------------------------------
|
| 41 |
+
with st.sidebar:
|
| 42 |
+
st.header("Configuration")
|
| 43 |
+
|
| 44 |
+
task = st.selectbox(
|
| 45 |
+
"Task",
|
| 46 |
+
options=["product prediction", "retrosynthesis prediction", "yield prediction"],
|
| 47 |
+
index=0,
|
| 48 |
+
help="Choose the task to run.",
|
| 49 |
+
)
|
| 50 |
+
|
| 51 |
with st.expander("How to format your CSV", expanded=False):
|
| 52 |
+
if task == "product prediction":
|
| 53 |
+
st.markdown(
|
| 54 |
+
"""
|
| 55 |
+
- `REACTANT` column is required.
|
| 56 |
- Optional columns: `REAGENT`, `SOLVENT`, `CATALYST`.
|
| 57 |
- If a field lists multiple compounds, separate them with a dot (`.`).
|
| 58 |
+
- For details, download **demo_reaction_data.csv** and check its contents.
|
| 59 |
+
- Output contains predicted product **SMILES** and the sum of log-likelihoods for each prediction,
|
| 60 |
+
sorted by log-likelihood (index 0 is most probable).
|
| 61 |
"""
|
| 62 |
+
)
|
| 63 |
+
elif task == "retrosynthesis prediction":
|
| 64 |
+
st.markdown(
|
| 65 |
+
"""
|
| 66 |
+
- `PRODUCT` column is required.
|
| 67 |
+
- No optional columns are used.
|
| 68 |
+
- If a field lists multiple compounds, separate them with a dot (`.`).
|
| 69 |
+
- For details, download **demo_retro_data.csv** and check its contents.
|
| 70 |
+
- Output contains predicted **sets of reactant SMILES** and their log-likelihoods,
|
| 71 |
+
sorted by log-likelihood (index 0 is most probable).
|
| 72 |
+
"""
|
| 73 |
+
)
|
| 74 |
+
else: # yield prediction
|
| 75 |
+
st.markdown(
|
| 76 |
+
"""
|
| 77 |
+
- `REACTANT` and `PRODUCT` columns are required.
|
| 78 |
+
- Optional columns: `REAGENT`, `SOLVENT`, `CATALYST`.
|
| 79 |
+
- If a field lists multiple compounds, separate them with a dot (`.`).
|
| 80 |
+
- For details, download **demo_yield_data.csv** and check its contents.
|
| 81 |
+
- Output contains predicted **reaction yield** on a **0–100% scale**.
|
| 82 |
+
"""
|
| 83 |
+
)
|
| 84 |
|
| 85 |
# ------------------------------
|
| 86 |
# Demo data download
|
|
|
|
| 117 |
# ------------------------------
|
| 118 |
with st.sidebar:
|
| 119 |
st.header("Configuration")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
# Model options tied to task
|
| 121 |
if task == "product prediction":
|
| 122 |
model_options = [
|