Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,9 +21,12 @@ path = 'ToxicityPrediction/Models/transformers/checkpoint-149-epoch-1'
|
|
| 21 |
rob_chem_model = ClassificationModel('roberta', 'seyonec/SMILES_tokenized_PubChem_shard00_160k',use_cuda=False ,args={'evaluate_each_epoch':True , 'evaluate_during_training_verbose':True, 'seed':4})
|
| 22 |
# Predict based on the input
|
| 23 |
rob_chem_model.model.eval()
|
| 24 |
-
target_name= st.text_input('Enter a SMILES string:')
|
|
|
|
|
|
|
|
|
|
| 25 |
predict_toxicity = st.button('Predict Toxicity')
|
| 26 |
if predict_toxicity:
|
| 27 |
-
predictions, raw_outputs = rob_chem_model.predict(
|
| 28 |
-
df_pred = pd.DataFrame({'
|
| 29 |
st.dataframe(df_pred)
|
|
|
|
| 21 |
rob_chem_model = ClassificationModel('roberta', 'seyonec/SMILES_tokenized_PubChem_shard00_160k',use_cuda=False ,args={'evaluate_each_epoch':True , 'evaluate_during_training_verbose':True, 'seed':4})
|
| 22 |
# Predict based on the input
|
| 23 |
rob_chem_model.model.eval()
|
| 24 |
+
#target_name= st.text_input('Enter a SMILES string:')
|
| 25 |
+
target_name = st.text_area("Enter smiles (one per line):", "")
|
| 26 |
+
target_name_list = target_name.splitlines()
|
| 27 |
+
target_name_list = [x.strip() for x in target_name_list]
|
| 28 |
predict_toxicity = st.button('Predict Toxicity')
|
| 29 |
if predict_toxicity:
|
| 30 |
+
predictions, raw_outputs = rob_chem_model.predict(target_name_list)
|
| 31 |
+
df_pred = pd.DataFrame({'Smiles':target_name_list,'predictions': predictions})
|
| 32 |
st.dataframe(df_pred)
|