Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ from rdkit import Chem
|
|
2 |
from rdkit.Chem import Draw
|
3 |
from transformers import pipeline
|
4 |
import gradio as gr
|
|
|
5 |
|
6 |
model_checkpoint = "FartLabs/FART_Augmented"
|
7 |
classifier = pipeline("text-classification", model=model_checkpoint, top_k=None)
|
@@ -17,9 +18,9 @@ def process_smiles(smiles):
|
|
17 |
predictions = classifier(canonical_smiles)
|
18 |
|
19 |
# Generate molecule image
|
20 |
-
img_path = "molecule
|
21 |
-
|
22 |
-
|
23 |
|
24 |
# Convert predictions to a friendly format
|
25 |
prediction_dict = {pred["label"]: pred["score"] for pred in predictions[0]}
|
|
|
2 |
from rdkit.Chem import Draw
|
3 |
from transformers import pipeline
|
4 |
import gradio as gr
|
5 |
+
from interpretability import save_high_quality_png
|
6 |
|
7 |
model_checkpoint = "FartLabs/FART_Augmented"
|
8 |
classifier = pipeline("text-classification", model=model_checkpoint, top_k=None)
|
|
|
18 |
predictions = classifier(canonical_smiles)
|
19 |
|
20 |
# Generate molecule image
|
21 |
+
img_path = "molecule"
|
22 |
+
filepath= "molecule.png"
|
23 |
+
save_high_quality_png(smiles, molecule)
|
24 |
|
25 |
# Convert predictions to a friendly format
|
26 |
prediction_dict = {pred["label"]: pred["score"] for pred in predictions[0]}
|