AleksanderObuchowski/medembed-small-onnx
This is an ONNX export of abhinand/MedEmbed-small-v0.1 optimized for use with transformers.js.
Model Description
This model is a medical text embedding model that has been converted to ONNX format for efficient inference in web browsers and edge devices. It includes both regular and quantized versions for different performance requirements.
Files
model.onnx
- Full precision ONNX modelmodel_quantized.onnx
- Quantized ONNX model (recommended for web deployment)tokenizer.json
- Tokenizer configurationconfig.json
- Model configuration- Other tokenizer files for full compatibility
Usage
With transformers.js
import { pipeline } from '@xenova/transformers';
// Load the model (quantized version for better performance)
const extractor = await pipeline('feature-extraction', 'AleksanderObuchowski/medembed-small-onnx', {
quantized: true
});
// Generate embeddings
const text = "This patient shows symptoms of diabetes.";
const embeddings = await extractor(text, { pooling: 'mean', normalize: true });
console.log(embeddings);
With Python (ONNX Runtime)
import onnxruntime as ort
from transformers import AutoTokenizer
import numpy as np
# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained('AleksanderObuchowski/medembed-small-onnx')
session = ort.InferenceSession('model_quantized.onnx')
# Tokenize input
text = "This patient shows symptoms of diabetes."
inputs = tokenizer(text, return_tensors="np")
# Run inference
outputs = session.run(None, dict(inputs))
embeddings = outputs[0]
Performance
The quantized model offers:
- Reduced file size (typically 50-75% smaller)
- Faster inference on CPU
- Lower memory usage
- Maintained accuracy for most use cases
Original Model
This model is based on abhinand/MedEmbed-small-v0.1, which is designed for medical text embeddings.
License
This model follows the same license as the original model. Please check the original model's license for details.
- Downloads last month
- 16
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support