Downloads · 30 days
0
Hosstia/bert-base-chinese-onnx
bert-base-chinese-onnx is a feature extraction model from Hosstia. Use it when you need embeddings to search or compare text. The card lists the license as apache-2.0.
INT8 quantized ONNX export of google-bert/bert-base-chinese for feature extraction (embedding extraction).
Downloads · 30 days
0
Access
Public
Updated Jul 25, 2026
Repo size
102 MB
Likes
0
Public
Click a slice to open those files.
.onnx102 MB · 100%
From the Hugging Face model README
INT8 quantized ONNX export of google-bert/bert-base-chinese for feature extraction (embedding extraction).
model_int8.onnx — INT8 quantized ONNX model (~28 MB)vocab.txt — WordPiece vocabularyThe [CLS] token hidden state (position 0) is used as a 768-dim embedding vector.
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("model_int8.onnx")
inputs = {
"input_ids": np.array([[...]], dtype=np.int64),
"attention_mask": np.array([[...]], dtype=np.int64),
"token_type_ids": np.array([[...]], dtype=np.int64),
}
last_hidden_state = session.run(None, inputs)[0] # (batch, seq_len, 768)
cls_embedding = last_hidden_state[:, 0, :] # (batch, 768)