Skip to content

Commit

Permalink
add error when no smiles
Browse files Browse the repository at this point in the history
  • Loading branch information
YojanaGadiya committed Jun 25, 2024
1 parent 7bf15f8 commit 5a51058
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pages/2_Model_Prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
else:
smiles_df = pd.DataFrame(text_input.split("\n"), columns=["smiles"])

if smiles_df.empty:
st.write("No SMILES provided.")
st.stop()

if fingerprint == "MHFP6":
fingerprint_name = "mhfp6"
elif fingerprint == "ECFP4":
Expand Down Expand Up @@ -193,6 +197,10 @@
["smiles", fingerprint_name]
]

if smiles_df.empty:
st.write("No SMILES provided.")
st.stop()

predictions = model.predict(smiles_df_subset[fingerprint_name].tolist())
prediction_proba = model.predict_proba(smiles_df_subset[fingerprint_name].tolist())
label_classes = model.classes_.tolist()
Expand Down

0 comments on commit 5a51058

Please sign in to comment.