Downloads · 30 days
63
6% of all-time downloads
Xenova/hubert-base-ls960
hubert-base-ls960 is a feature extraction model from Xenova. Use it when you need embeddings to search or compare text. It is set up for transformers.js.
https://huggingface.co/facebook/hubert-base-ls960 with ONNX weights to be compatible with Transformers.js.
Downloads · 30 days
63
6% of all-time downloads
All-time downloads
1.1K
Public
Repo size
662 MB
Likes
2
Public
Click a slice to open those files.
.onnx662 MB · 100%
From the Hugging Face model README
https://huggingface.co/facebook/hubert-base-ls960 with ONNX weights to be compatible with Transformers.js.
If you haven't already, you can install the Transformers.js JavaScript library from NPM using:
npm i @xenova/transformers
Example: Load and run a HubertModel for feature extraction.
import { AutoProcessor, AutoModel, read_audio } from '@xenova/transformers';
// Read and preprocess audio
const processor = await AutoProcessor.from_pretrained('Xenova/hubert-base-ls960');
const audio = await read_audio('https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/jfk.wav', 16000);
const inputs = await processor(audio);
// Load and run model with inputs
const model = await AutoModel.from_pretrained('Xenova/hubert-base-ls960');
const output = await model(inputs);
// {
// last_hidden_state: Tensor {
// dims: [ 1, 549, 768 ],
// type: 'float32',
// data: Float32Array(421632) [0.0682469978928566, 0.08104046434164047, -0.4975186586380005, ...],
// size: 421632
// }
// }
Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using 🤗 Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).