bert-tiny-chinese-onnx

Model ckiplab/bert-tiny-chinese, converted to ONNX format for use with ONNX Runtime.

Original model

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)

For details: ckiplab/ckip-transformers

ONNX format

Export was performed using torch.onnx.export with dynamic axes for batch and sequence length.

Files:

  • model.onnx โ€“ full model (encoder + pooler)
  • config.json โ€“ model configuration

Usage

import onnxruntime as ort
import numpy as np

session = ort.InferenceSession("model.onnx")
inputs = {
    "input_ids": np.array([[101,  ... , 102]], dtype=np.int64),
    "attention_mask": np.array([[1, ..., 1]], dtype=np.int64),
    "token_type_ids": np.array([[0, ..., 0]], dtype=np.int64),
}
outputs = session.run(None, inputs)

License

The original model is distributed under GPL-3.0. This ONNX export is provided under Apache License 2.0.

Downloads last month
16
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support