Views
No views yet
| Package | Version |
|---|---|
| transformers | 4.48.3 |
| optimum | 1.24.0 |
| onnx | 1.17.0 |
| onnxruntime | 1.21.0 |
| torch | 2.5.1 |
| numpy | 1.26.4 |
| huggingface_hub | 0.28.1 |
| python | 3.12.9 |
| system | Darwin 24.3.0 |
| Optimization | Setting |
|---|---|
| Graph Optimization Level | Extended |
| Optimize for GPU | Yes |
| Use FP16 | No |
| Transformers Specific Optimizations Enabled | Yes |
| Gelu Fusion Enabled | Yes |
| Layer Norm Fusion Enabled | Yes |
| Attention Fusion Enabled | Yes |
| Skip Layer Norm Fusion Enabled | Yes |
| Gelu Approximation Enabled | Yes |
1from optimum.onnxruntime import ORTModelForSequenceClassification
2from transformers import AutoTokenizer
3
4# Load model and tokenizer
5model = ORTModelForSequenceClassification.from_pretrained("quantized_model")
6tokenizer = AutoTokenizer.from_pretrained("quantized_model")
7
8# Prepare input
9text = "Your text here"
10inputs = tokenizer(text, return_tensors="pt")
11
12# Run inference
13outputs = model(**inputs)