Downloads · 30 days
2
3% of all-time downloads
Kirosama/medical-guardrail-mmbert-V3
medical-guardrail-mmbert-V3 is a text classification model from Kirosama. Use it when you need a label for a piece of text. It is set up for transformers.
This is an optimized, multi-label sequence classification model designed for medical routing and safety guardrails. It is built on top of jhu-clsp/mmBERT-base and fine-tuned for high-speed, enterprise-grade inference.
Downloads · 30 days
2
3% of all-time downloads
All-time downloads
75
Public
Parameters
308M
2.8 GB on disk
Likes
0
Public
Click a slice to open those files.
.onnx1.5 GB · 55%
From the Hugging Face model README
This is an optimized, multi-label sequence classification model designed for medical routing and safety guardrails. It is built on top of jhu-clsp/mmBERT-base and fine-tuned for high-speed, enterprise-grade inference.
This repository contains the model in three different formats to support various deployment environments:
onnx/fp32 directory.onnx/int8 directory (Recommended for CPU production).The model outputs probabilities for 6 distinct classes. In production, we route based on the following strict priority order to ensure safety:
Because the PyTorch files are in the root directory, you can load them using standard transformers.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
repo_id = "Kirosama/medical-guardrail-mmbert-V3"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForSequenceClassification.from_pretrained(repo_id)
To load the ONNX graph, switch from transformers to optimum and specify the subfolder.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
repo_id = "Kirosama/medical-guardrail-mmbert-V3"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
ort_fp32_model = ORTModelForSequenceClassification.from_pretrained(
repo_id,
subfolder="onnx/fp32"
)
This is the ultra-fast production model. You must specify both the subfolder and the custom file_name because the quantizer appends _quantized to the file.
from optimum.onnxruntime import ORTModelForSequenceClassification
from transformers import AutoTokenizer
repo_id = "Kirosama/medical-guardrail-mmbert-V3"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
ort_int8_model = ORTModelForSequenceClassification.from_pretrained(
repo_id,
subfolder="onnx/int8",
file_name="model_quantized.onnx"
)