Re-allow multithreading on service. Add results table

This commit is contained in:
William Jeynes
2026-03-24 18:29:40 +00:00
parent 80bc151379
commit 624d45bc53
4 changed files with 31 additions and 18 deletions
+5 -5
View File
@@ -102,6 +102,11 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
flan_model.to(device)
flan_model.eval()
label_token_ids = {
label: flan_tokenizer(label, add_special_tokens=False).input_ids[0]
for label in LABEL_TO_INT.keys()
}
def format_prompt(text: str) -> str:
return (
@@ -204,11 +209,6 @@ def evaluate(req: EvalRequest):
skip_special_tokens=True
)
label_token_ids = {
label: flan_tokenizer(label, add_special_tokens=False).input_ids[0]
for label in LABEL_TO_INT.keys()
}
label_logits = torch.tensor(
[logits[0, tid].item() for tid in label_token_ids.values()]
)