ONNX Model Zoo

Xenova/hubert-base-ls960

By Xenova · ↓ 11 · ♥ 1 · Updated 2024-10-08

What's in this repo

This page lists the files in Xenova/hubert-base-ls960, including model.onnx, model_fp16.onnx, model_quantized.onnx.

  • 3 ONNX models (.onnx files)
  • 8 files, including 3 .json, 3 .onnx, 1 .md
  • Last updated 2024-10-08

ONNX files

File Size Download
onnx/model.onnx — Download
onnx/model_fp16.onnx — Download
onnx/model_quantized.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

https://huggingface.co/facebook/hubert-base-ls960 with ONNX weights to be compatible with Transformers.js.

Usage (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).

Model info

feature-extraction transformers.js
transformers.js onnx hubert feature-extraction base_model:facebook/hubert-base-ls960 base_model:quantized:facebook/hubert-base-ls960 region:us
↓ 11 ♥ 1

Created: 2023-12-11

Updated: 2024-10-08

View on Hugging Face

Files (8)

.gitattributes
README.md
config.json
onnx/model.onnx ONNX
onnx/model_fp16.onnx ONNX
onnx/model_quantized.onnx ONNX
preprocessor_config.json
quantize_config.json

Related models