Views
No views yet
| Head | Accuracy | Macro F1 |
|---|---|---|
| Intent (22 classes) | 97.35% | 0.9733 |
| Resource Density (5 classes) | 99.95% | 0.9987 |
1import requests
2
3r = requests.post("https://ueg-api.onrender.com/classify",
4 json={"text": "Write a Python function to sort a list"})
5print(r.json())1import onnxruntime as ort
2import numpy as np
3from tokenizers import Tokenizer
4from huggingface_hub import hf_hub_download
5
6# Load tokenizer
7tok_path = hf_hub_download("rufatronics/ueg-classifier",
8 "tokenizer/tokenizer.json")
9tokenizer = Tokenizer.from_file(tok_path)
10tokenizer.enable_padding(pad_id=0, pad_token="[PAD]", length=128)
11tokenizer.enable_truncation(max_length=128)
12
13# Load ONNX model + data file (both needed)
14onnx_path = hf_hub_download("rufatronics/ueg-classifier",
15 "export/ueg_model.onnx")
16data_path = hf_hub_download("rufatronics/ueg-classifier",
17 "export/ueg_model.onnx.data")
18
19sess = ort.InferenceSession(onnx_path,
20 providers=["CPUExecutionProvider"])
21
22# Inference
23enc = tokenizer.encode("Write a Python function to reverse a string")
24ids = np.array([enc.ids], dtype=np.int64)
25mask = np.array([enc.attention_mask], dtype=np.int64)
26
27logits_intent, logits_resource = sess.run(None,
28 {"input_ids": ids, "attention_mask": mask})
29
30intent_class = np.argmax(logits_intent)| File | Description |
|---|---|
checkpoint_best.pt | PyTorch weights (best validation epoch) |
checkpoint_latest.pt | PyTorch weights (final epoch) |
export/ueg_model.onnx | ONNX model for production inference |
export/ueg_model.onnx.data | ONNX external data (required alongside .onnx) |
export/config.json | Architecture hyperparameters |
export/benchmark.json | Inference latency benchmark |
tokenizer/tokenizer.json | Tokenizer definition |
tokenizer/tokenizer_config.json | Tokenizer config with pad/cls/sep IDs |
labels/intent_classes.json | Intent class label mappings |
labels/resource_classes.json | Resource density class mappings |
1@misc{ueg2026,
2 title={UEG: Universal Edge Gateway for AI Request Routing},
3 author={Ahmad Garba},
4 year={2026},
5 url={https://huggingface.co/rufatronics/ueg-classifier}
6}