Bradleyyb37/Quantitative_toxicity_prediction
1
๐งช ActFound-based Toxicity Predictor
This Space provides EC10 toxicity predictions from SMILES strings using a fine-tuned ActFound meta-learning model.
๐ง How it works
- Base model: ActFoundRegressor (meta-learning QSAR)
- Input: SMILES โ 2048-d Morgan fingerprint (via RDKit)
- Inner loop: Meta-learning adaptation using a fixed support set (
EC10_support.json) - Output: Predicted EC10 (e.g.,
-log10(EC)in BEAS-2b cells)
๐ Files
app.pyโ Gradio UI (single + batch prediction)inference.pyโ Core inference logic (predict,predict_batch)requirements.txtโ Dependency versionsEC10_support.jsonโ Support compounds and EC10 labelsactfound_finetuned_ec10.ptโ Fine-tuned model weights (state_dict)Actfound_demo/โ Model definitions (system_actfound.py, etc.)
โ Note:system_actfound.pymust be edited so that all.cuda()calls are replaced with device-agnostic code (e.g.,.to(device)).
โ Usage (Web UI)
- Open the Space.
- Single Prediction tab:
- Enter a SMILES string.
- Click Predict.
- The EC10 value will be displayed on the right.
- Batch Prediction tab:
- Fill or paste a list of SMILES in the table.
- Click Predict Batch.
- A result table with predicted EC10 values will appear.
๐ Programmatic API Example (Python)
If your Space is public (e.g., https://huggingface.co/spaces/yourname/actfound-ec10), you can call the Gradio API endpoint like:
import requests
SPACE_URL = "https://yourname-actfound-ec10.hf.space"
payload = {
"data": ["CC1=CC=CC=C1"] # single SMILES input for the main function
}
res = requests.post(f"{SPACE_URL}/api/predict", json=payload)
print(res.json())
