Views
No views yet
| Parameter | Value |
|---|---|
| Architecture | BERT (BertForMaskedLM) |
| Number of layers | 4 |
| Hidden size | 312 |
| Attention heads | 12 |
| Intermediate size | 1248 |
| Vocabulary size | 21128 |
| Max sequence length | 512 |
| Activation function | GELU |
| Language | Traditional Chinese (zh) |
torch.onnx.export with dynamic axes for batch and sequence length.model.onnx – full model (encoder + pooler)config.json – model configuration1import onnxruntime as ort
2import numpy as np
3
4session = ort.InferenceSession("model.onnx")
5inputs = {
6 "input_ids": np.array([[101, ... , 102]], dtype=np.int64),
7 "attention_mask": np.array([[1, ..., 1]], dtype=np.int64),
8 "token_type_ids": np.array([[0, ..., 0]], dtype=np.int64),
9}
10outputs = session.run(None, inputs)