voidful / asr_hubert_cluster_bart_base

huggingface.co
Total runs: 21
24-hour runs: 0
7-day runs: -2
30-day runs: 7
Model's Last Updated: August 05 2023
automatic-speech-recognition

Introduction of asr_hubert_cluster_bart_base

Model Details of asr_hubert_cluster_bart_base

voidful/asr_hubert_cluster_bart_base

Usage

download file

wget https://raw.githubusercontent.com/voidful/hubert-cluster-code/main/km_feat_100_layer_20
wget https://cdn-media.huggingface.co/speech_samples/sample1.flac

Hubert kmeans code

import joblib
import torch
from transformers import Wav2Vec2FeatureExtractor, HubertModel
import soundfile as sf


class HubertCode(object):
    def __init__(self, hubert_model, km_path, km_layer):
        self.processor = Wav2Vec2FeatureExtractor.from_pretrained(hubert_model)
        self.model = HubertModel.from_pretrained(hubert_model)
        self.km_model = joblib.load(km_path)
        self.km_layer = km_layer
        self.C_np = self.km_model.cluster_centers_.transpose()
        self.Cnorm_np = (self.C_np ** 2).sum(0, keepdims=True)

        self.C = torch.from_numpy(self.C_np)
        self.Cnorm = torch.from_numpy(self.Cnorm_np)
        if torch.cuda.is_available():
            self.C = self.C.cuda()
            self.Cnorm = self.Cnorm.cuda()
            self.model = self.model.cuda()

    def __call__(self, filepath, sampling_rate=None):
        speech, sr = sf.read(filepath)
        input_values = self.processor(speech, return_tensors="pt", sampling_rate=sr).input_values
        if torch.cuda.is_available():
            input_values = input_values.cuda()
        hidden_states = self.model(input_values, output_hidden_states=True).hidden_states
        x = hidden_states[self.km_layer].squeeze()
        dist = (
                x.pow(2).sum(1, keepdim=True)
                - 2 * torch.matmul(x, self.C)
                + self.Cnorm
        )
        return dist.argmin(dim=1).cpu().numpy()

input

hc = HubertCode("facebook/hubert-large-ll60k", './km_feat_100_layer_20', 20)
voice_ids = hc('./sample1.flac')

bart model

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tokenizer = AutoTokenizer.from_pretrained("voidful/asr_hubert_cluster_bart_base")
model = AutoModelForSeq2SeqLM.from_pretrained("voidful/asr_hubert_cluster_bart_base")

generate output

gen_output = model.generate(input_ids=tokenizer("".join([f":vtok{i}:" for i in voice_ids]),return_tensors='pt').input_ids,max_length=1024)
print(tokenizer.decode(gen_output[0], skip_special_tokens=True))
Result

going along slushy country roads and speaking to damp audience in drifty school rooms day after day for a fortnight he'll have to put in an appearance at some place of worship on sunday morning and he can come to ask immediately afterwards

Runs of voidful asr_hubert_cluster_bart_base on huggingface.co

21
Total runs
0
24-hour runs
-1
3-day runs
-2
7-day runs
7
30-day runs

More Information About asr_hubert_cluster_bart_base huggingface.co Model

More asr_hubert_cluster_bart_base license Visit here:

https://choosealicense.com/licenses/apache-2.0

asr_hubert_cluster_bart_base huggingface.co

asr_hubert_cluster_bart_base huggingface.co is an AI model on huggingface.co that provides asr_hubert_cluster_bart_base's model effect (), which can be used instantly with this voidful asr_hubert_cluster_bart_base model. huggingface.co supports a free trial of the asr_hubert_cluster_bart_base model, and also provides paid use of the asr_hubert_cluster_bart_base. Support call asr_hubert_cluster_bart_base model through api, including Node.js, Python, http.

asr_hubert_cluster_bart_base huggingface.co Url

https://huggingface.co/voidful/asr_hubert_cluster_bart_base

voidful asr_hubert_cluster_bart_base online free

asr_hubert_cluster_bart_base huggingface.co is an online trial and call api platform, which integrates asr_hubert_cluster_bart_base's modeling effects, including api services, and provides a free online trial of asr_hubert_cluster_bart_base, you can try asr_hubert_cluster_bart_base online for free by clicking the link below.

voidful asr_hubert_cluster_bart_base online free url in huggingface.co:

https://huggingface.co/voidful/asr_hubert_cluster_bart_base

asr_hubert_cluster_bart_base install

asr_hubert_cluster_bart_base is an open source model from GitHub that offers a free installation service, and any user can find asr_hubert_cluster_bart_base on GitHub to install. At the same time, huggingface.co provides the effect of asr_hubert_cluster_bart_base install, users can directly use asr_hubert_cluster_bart_base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

asr_hubert_cluster_bart_base install url in huggingface.co:

https://huggingface.co/voidful/asr_hubert_cluster_bart_base

Url of asr_hubert_cluster_bart_base

asr_hubert_cluster_bart_base huggingface.co Url

Provider of asr_hubert_cluster_bart_base huggingface.co

voidful
ORGANIZATIONS

Other API from voidful

huggingface.co

Total runs: 180
Run Growth: 131
Growth Rate: 72.78%
Updated:March 25 2023
huggingface.co

Total runs: 78
Run Growth: 20
Growth Rate: 25.64%
Updated:October 09 2023
huggingface.co

Total runs: 14
Run Growth: 0
Growth Rate: 0.00%
Updated:February 20 2023
huggingface.co

Total runs: 13
Run Growth: 3
Growth Rate: 23.08%
Updated:July 25 2023
huggingface.co

Total runs: 9
Run Growth: 6
Growth Rate: 66.67%
Updated:December 25 2024
huggingface.co

Total runs: 8
Run Growth: -499
Growth Rate: -6237.50%
Updated:January 07 2026
huggingface.co

Total runs: 4
Run Growth: 0
Growth Rate: 0.00%
Updated:December 02 2025
huggingface.co

Total runs: 4
Run Growth: -2
Growth Rate: -50.00%
Updated:November 29 2024
huggingface.co

Total runs: 4
Run Growth: 0
Growth Rate: 0.00%
Updated:April 10 2024