Views
No views yet
| Model File | Description | Use Case |
|---|---|---|
model.onnx | Original ONNX model | Best accuracy, larger size |
model_fp16.onnx | 16-bit floating point | Good balance of accuracy and speed |
model_int8.onnx | 8-bit integer quantized | Faster inference, smaller size |
model_q4.onnx | 4-bit quantized | Very fast, very small |
model_q4f16.onnx | 4-bit with FP16 | Optimized for specific hardware |
model_quantized.onnx | Standard quantized | General purpose optimization |
model_uint8.onnx | Unsigned 8-bit | Mobile/edge deployment |
model_bnb4.onnx | BitsAndBytes 4-bit | Advanced quantization |
1import { pipeline } from '@xenova/transformers';
2
3// Load the model
4const classifier = await pipeline('text-classification', 'kousik-2310/intent-classifier-minilm');
5
6// Classify text
7const result = await classifier('I want to book a flight to New York');
8console.log(result);1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2from transformers import pipeline
3
4# Load tokenizer and model
5tokenizer = AutoTokenizer.from_pretrained("kousik-2310/intent-classifier-minilm")
6model = AutoModelForSequenceClassification.from_pretrained("kousik-2310/intent-classifier-minilm")
7
8# Create pipeline
9classifier = pipeline("text-classification", model=model, tokenizer=tokenizer)
10
11# Classify text
12result = classifier("I want to book a flight to New York")
13print(result)1import onnxruntime as ort
2from transformers import AutoTokenizer
3
4# Load tokenizer
5tokenizer = AutoTokenizer.from_pretrained("kousik-2310/intent-classifier-minilm")
6
7# Load ONNX model
8session = ort.InferenceSession("onnx/model_int8.onnx")
9
10# Tokenize input
11text = "I want to book a flight to New York"
12inputs = tokenizer(text, return_tensors="np", padding=True, truncation=True)
13
14# Run inference
15outputs = session.run(None, {
16 "input_ids": inputs["input_ids"],
17 "attention_mask": inputs["attention_mask"]
18})
19
20# Process results
21predictions = outputs[0]model.onnx, good with quantized versionsmodel_q4.onnx and model_int8.onnx1@misc{intent-classifier-minilm,
2 title={Intent Classifier MiniLM},
3 author={kousik-2310},
4 year={2024},
5 url={https://huggingface.co/kousik-2310/intent-classifier-minilm}
6}