Add onnx-djl module: DistilBERT sentiment with ONNX Runtime and DJL, batching and a Spring Boot endpoint with measured latency
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G8ikz8xdWuTP5yun8DZ1hk
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
Model: distilbert-base-uncased-finetuned-sst-2-english, ONNX export, 267 MB
|
||||
ONNX Runtime 1.31.0
|
||||
|
||||
Inputs of the ONNX graph:
|
||||
input_ids TensorInfo(javaType=INT64,onnxType=ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64,shape=[-1, -1],dimNames=[batch_size,sequence_length])
|
||||
attention_mask TensorInfo(javaType=INT64,onnxType=ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64,shape=[-1, -1],dimNames=[batch_size,sequence_length])
|
||||
Outputs:
|
||||
logits TensorInfo(javaType=FLOAT,onnxType=ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT,shape=[-1, 2],dimNames=[batch_size,""])
|
||||
|
||||
Tokenizing "I loved this film.":
|
||||
tokens: [[CLS], i, loved, this, film, ., [SEP]]
|
||||
input_ids: [101, 1045, 3866, 2023, 2143, 1012, 102]
|
||||
attention_mask: [1, 1, 1, 1, 1, 1, 1]
|
||||
|
||||
Two texts in one batch are padded to the same length:
|
||||
[[CLS], i, loved, this, film, ., [SEP]]
|
||||
mask [1, 1, 1, 1, 1, 1, 1]
|
||||
[[CLS], bad, ., [SEP], [PAD], [PAD], [PAD]]
|
||||
mask [1, 1, 1, 1, 0, 0, 0]
|
||||
Reference in New Issue
Block a user