Fabian commited on
Commit ·
dae9496
1
Parent(s): f203922
improved description
Browse files
app.py
CHANGED
|
@@ -31,15 +31,15 @@ class ModelWrapper(nn.Module):
|
|
| 31 |
# Initialize the wrapped model as a global variable
|
| 32 |
wrapper = ModelWrapper(model)
|
| 33 |
|
| 34 |
-
def
|
| 35 |
"""
|
| 36 |
-
|
| 37 |
|
| 38 |
Args:
|
| 39 |
smiles (str): The smiles string to analyze
|
| 40 |
|
| 41 |
Returns:
|
| 42 |
-
str:
|
| 43 |
"""
|
| 44 |
try:
|
| 45 |
mol = Chem.MolFromSmiles(smiles)
|
|
@@ -87,7 +87,7 @@ def get_attribution_values(smiles: str) -> str:
|
|
| 87 |
|
| 88 |
# Create the Gradio interface
|
| 89 |
demo = gr.Interface(
|
| 90 |
-
fn=
|
| 91 |
inputs=gr.Textbox(placeholder="Enter smiles to analyze..."),
|
| 92 |
outputs=gr.Textbox(lines=10), # Changed from gr.JSON() to gr.Textbox()
|
| 93 |
title="Explainable Inhibitory Constant Prediction for Delta Opioid Receptor",
|
|
|
|
| 31 |
# Initialize the wrapped model as a global variable
|
| 32 |
wrapper = ModelWrapper(model)
|
| 33 |
|
| 34 |
+
def analyse_inhibitory_constant_for_delta_opioid_receptor(smiles: str) -> str:
|
| 35 |
"""
|
| 36 |
+
Analyses the inhibitory constant for a given molecule to delta opioid receptor and gives the contribution of each smiles symbol.
|
| 37 |
|
| 38 |
Args:
|
| 39 |
smiles (str): The smiles string to analyze
|
| 40 |
|
| 41 |
Returns:
|
| 42 |
+
str: The inhibitory constant and a markdown table with the smiles symbols and their attribution values for the inhibitory constant prediction
|
| 43 |
"""
|
| 44 |
try:
|
| 45 |
mol = Chem.MolFromSmiles(smiles)
|
|
|
|
| 87 |
|
| 88 |
# Create the Gradio interface
|
| 89 |
demo = gr.Interface(
|
| 90 |
+
fn=analyse_inhibitory_constant_for_delta_opioid_receptor,
|
| 91 |
inputs=gr.Textbox(placeholder="Enter smiles to analyze..."),
|
| 92 |
outputs=gr.Textbox(lines=10), # Changed from gr.JSON() to gr.Textbox()
|
| 93 |
title="Explainable Inhibitory Constant Prediction for Delta Opioid Receptor",
|