Views
No views yet
All credit for this model goes to the original authors. This repository is only a format conversion (PyTorch to ONNX) for CPU / onnxruntime inference. The weights and behaviour are unchanged from the original model.
microsoft/deberta-v3-largeonnx/model.onnx + onnx/model.onnx_data: the ONNX graph and weights
(external-data format), exported with torch.onnx at opset 17.tokenizer.json, tokenizer_config.json, config.json: copied unchanged from
the original model.turbochick.json: small runtime metadata (max sequence length).1import onnxruntime as ort
2from tokenizers import Tokenizer
3
4tok = Tokenizer.from_file("tokenizer.json")
5sess = ort.InferenceSession("onnx/model.onnx", providers=["CPUExecutionProvider"])
6enc = tok.encode("some text to score")
7import numpy as np
8ids = np.array([enc.ids], dtype=np.int64)
9mask = np.array([enc.attention_mask], dtype=np.int64)
10logit = sess.run(None, {"input_ids": ids, "attention_mask": mask})[0]
11prob_machine = 1 / (1 + np.exp(-logit[0][0]))