lquint/clap-htsat-unfused-onnx
By lquint · ↓ 0 · ♥ 0 · Updated 2026-03-03
What's in this repo
This page lists the files in lquint/clap-htsat-unfused-onnx, including model.onnx.
- 1 ONNX models (.onnx files)
- 4 files, including 1 .md, 1 .py, 1 .onnx
- Last updated 2026-03-03
ONNX files
| File | Size | Download |
|---|---|---|
| model.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
CLAP HTSAT-Unfused (ONNX Audio Encoder)
ONNX export of the audio encoder from laion/clap-htsat-unfused for audio embedding generation.
Model Details
- Base Model: laion/clap-htsat-unfused (ClapModel)
- Exported Component: Audio encoder (ClapAudioModel) + projection layer (ClapProjectionLayer)
- Architecture: HTSAT (HTS-Audio Transformer) + 2-layer MLP projection
- Parameters: ~29M (audio encoder only; full CLAP includes text encoder too)
- Output: 512-dimensional L2-normalized audio embeddings
- License: Apache-2.0
ONNX Details
| Property | Value |
|---|---|
| File | model.onnx |
| Size | ~114 MB |
| Opset | 18 |
| Inputs | input_features [batch, 1, 1001, 64] float32, is_longer [batch, 1] bool |
| Outputs | embeddings [batch, 512] float32 (L2-normalized) |
Usage with ONNX Runtime
import onnxruntime as ort
import numpy as np
session = ort.InferenceSession("model.onnx")
input_features = np.random.randn(1, 1, 1001, 64).astype(np.float32)
is_longer = np.array([[False]], dtype=bool)
embeddings = session.run(None, {"input_features": input_features, "is_longer": is_longer})[0]
print(f"Embedding shape: {embeddings.shape}") # (1, 512)
Export Details
Exported from laion/clap-htsat-unfused using PyTorch torch.onnx.export with a custom wrapper that:
- Runs the HTSAT audio encoder (
ClapAudioModel) - Applies the projection layer (
ClapProjectionLayer: Linear(768→512) → ReLU → Linear(512→512)) - L2-normalizes the output (matching
ClapModel.get_audio_features()behavior)
Intended Use
This ONNX model is designed for use with MLNet.AudioInference.Onnx for audio embedding generation in .NET applications via the model-packages-prototype SDK.
Files (4)
Related models
More from lquint
More models
No task type declared.