ContentVec
The ContentVec model in safetensors format, compatible with HuggingFace Transformers.
Uses
To extract features, use the following code:
from transformers import AutoProcessor, HubertModel
import librosa
# Load the processor and model
processor = AutoProcessor.from_pretrained("safe-models/ContentVec")
hubert = HubertModel.from_pretrained("safe-models/ContentVec")
# Read the audio
audio, sr = librosa.load("test.wav", sr=16000)
input_values = processor(audio, sampling_rate=sr, return_tensors="pt").input_values
# Get the layer 12 output as the feature
feats = hubert(input_values, output_hidden_states=True)["hidden_states"][12]
print(f"{feats.shape=}")
- Downloads last month
- 516
Inference Providers
NEW
This model is not currently available via any of the supported third-party Inference Providers, and
the model is not deployed on the HF Inference API.