Downloads · 30 days
160K
0% of all-time downloads
lengyue233/content-vec-best
content-vec-best is a machine learning model from lengyue233. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as mit.
Official Repo: ContentVec This repo brings fairseq ContentVec model to HuggingFace Transformers.
Downloads · 30 days
160K
0% of all-time downloads
All-time downloads
43.7M
Public
Repo size
757 MB
Likes
23
Public
Click a slice to open those files.
.bin378 MB · 100%
From the Hugging Face model README
Official Repo: ContentVec
This repo brings fairseq ContentVec model to HuggingFace Transformers.
To use this model, you need to define
from transformers import HubertModel
import torch.nn as nn
class HubertModelWithFinalProj(HubertModel):
def __init__(self, config):
super().__init__(config)
# The final projection layer is only used for backward compatibility.
# Following https://github.com/auspicious3000/contentvec/issues/6
# Remove this layer is necessary to achieve the desired outcome.
self.final_proj = nn.Linear(config.hidden_size, config.classifier_proj_size)
and then load the model with
audio = torch.randn(1, 16000)
model = HubertModelWithFinalProj.from_pretrained("lengyue233/content-vec-best")
x = model(audio)["last_hidden_state"]
You need to download the ContentVec_legacy model from the official repo, and then run
python convert.py