Spaces:
Build error
Build error
File size: 858 Bytes
e7b7a72 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | """
Model utilities for loading pre-trained weights
"""
import torch
from transformers import AutoModel
def load_classifier_weights(model, weights_path="classifier_weights.pth"):
"""Load classification head weights into model"""
checkpoint = torch.load(weights_path, map_location="cpu")
model.classifier.load_state_dict(checkpoint['classifier_state_dict'])
return model
def get_model_info():
"""Return model metadata"""
return {
"name": "Phishing Email Detector",
"version": "1.0.0",
"author": "Mohamed Amine Marzouk",
"f1_score": 0.9878,
"precision": 0.9901,
"recall": 0.9854,
"auc_roc": 0.9991,
"training_time": "16 hours",
"inference_time": "82ms",
"training_data": "181,985 emails",
"model_type": "DistilRoBERTa-base + 5-layer MLP"
}
|