toxipredict-api / routes /models.py
Arko006's picture
Upload routes/models.py with huggingface_hub
3ce0324 verified
Raw
History Blame
666 Bytes
from fastapi import APIRouter
from config import TASK_NAMES, TASK_CLASSES, NUM_TASKS
router = APIRouter(prefix="/api")
@router.get("/models")
async def list_models():
return {
"models": [
{
"name": "toxipredict-gnn-v1",
"architecture": "MultiTaskGNN (2×GATConv, 4 heads, 12 task heads)",
"num_tasks": NUM_TASKS,
"tasks": [
{"assay": name, "target_class": TASK_CLASSES.get(name, "Unknown")}
for name in TASK_NAMES
],
"version": "1.0.0",
"status": "loaded",
}
]
}