1import torch, json
2from transformers import AutoTokenizer
3from modeling import MentalHealthClassifierV6
4
5device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
6with open("model_config.json") as f: config = json.load(f)
7with open("preprocess_stats.json") as f: stats = json.load(f)
8
9model = MentalHealthClassifierV6(model_name=config["model_name"])
10model.load_state_dict(torch.load("pytorch_model.bin", map_location=device))
11model.to(device).eval()
12tokenizer = AutoTokenizer.from_pretrained(".")
13
14# Normalise structured features using stats