Instructions to use FaisaI/tadabur-embedding with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FaisaI/tadabur-embedding with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="FaisaI/tadabur-embedding", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FaisaI/tadabur-embedding", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
tadabur-embedding
tadabur-embedding is an audio embedding model pretrained on the tadabur dataset. It maps audio into compact vector representations β at the clip level or the frame level β that can power a wide range of downstream tasks.
The model is an EAT (Efficient Audio Transformer) base encoder (12 Transformer blocks, 768-dim) pretrained from scratch on Quranic recitation audio.
Use cases
- Retrieval / semantic search β find the most similar recitations to a query clip.
- Deduplication β detect near-duplicate audio across large collections.
- Clustering β group recordings by reciter, style, or acoustic similarity.
- Classification β use embeddings as features for downstream classifiers.
- Frame analysis β use the per-frame embedding sequence (before pooling) for tasks that need temporal detail: localizing acoustic events within a clip, aligning or segmenting recitations, and detecting variations over time.
Quick start
import torch
import torchaudio
from transformers import AutoModel
model = AutoModel.from_pretrained("FaisaI/tadabur-embedding", trust_remote_code=True).eval()
# --- Load audio (16 kHz mono) ---
waveform, sr = torchaudio.load("recitation.wav")
waveform = waveform.mean(dim=0, keepdim=True) # mono
if sr != 16000:
waveform = torchaudio.functional.resample(waveform, sr, 16000)
# --- Log-mel spectrogram (EAT preprocessing) ---
waveform = waveform - waveform.mean()
mel = torchaudio.compliance.kaldi.fbank(
waveform,
htk_compat=True,
sample_frequency=16000,
use_energy=False,
window_type="hanning",
num_mel_bins=128,
dither=0.0,
frame_shift=10,
) # (n_frames, 128)
# Pad or truncate to 1024 frames (= 10.24 s)
target_length = 1024
n_frames = mel.shape[0]
if n_frames < target_length:
mel = torch.nn.functional.pad(mel, (0, 0, 0, target_length - n_frames))
else:
mel = mel[:target_length]
# Normalize with tadabur dataset statistics
norm_mean, norm_std = -4.381, 3.628
mel = (mel - norm_mean) / (norm_std * 2)
mel = mel[None, None] # (1, 1, 1024, 128)
# --- Extract embeddings ---
with torch.no_grad():
features = model.extract_features(mel) # (1, 513, 768) = CLS + 512 frame patches
clip_embedding = features[:, 0] # (1, 768) utterance-level (CLS token)
frame_embeddings = features[:, 1:] # (1, 512, 768) frame-level (~50 Hz)
For longer audio, split into 10.24 s segments and embed each one. Frame-level embeddings (features[:, 1:]) preserve temporal order and can be used directly for alignment and localization tasks.
Training data
Pretrained on FaisaI/tadabur, a dataset of Quranic recitation audio. Spectrogram normalization statistics (norm_mean = -4.381, norm_std = 3.628) were computed on this dataset β use them (not the AudioSet defaults) when preprocessing.
Intended use & limitations
- Best suited for recitation-style Arabic speech audio; performance on unrelated audio domains is not guaranteed.
- Input is expected as 16 kHz mono audio converted to 128-bin log-mel spectrograms, in windows of up to 10.24 s.
License
Released under CC BY-NC 4.0 β free for non-commercial use with attribution.
Acknowledgements
The model architecture and pretraining recipe follow EAT: Self-Supervised Pre-Training with Efficient Audio Transformer (Chen et al., 2024). The Hugging Face wrapper code is adapted from worstchan/EAT-base_epoch30_pretrain.
Citation
@misc{tadabur-embedding,
title = {tadabur-embedding: audio embeddings for Quranic recitation},
author = {Faisal},
year = {2026},
url = {https://huggingface.co/FaisaI/tadabur-embedding}
}
- Downloads last month
- 15