TencentGameMate / chinese-wav2vec2-large

huggingface.co
Total runs: 9.1K
24-hour runs: -818
7-day runs: -6.4K
30-day runs: -17.9K
Model's Last Updated: 6월 24 2022

Introduction of chinese-wav2vec2-large

Model Details of chinese-wav2vec2-large

Pretrained on 10k hours WenetSpeech L subset. More details in TencentGameMate/chinese_speech_pretrain

This model does not have a tokenizer as it was pretrained on audio alone. In order to use this model speech recognition, a tokenizer should be created and the model should be fine-tuned on labeled text data.

python package: transformers==4.16.2



import torch
import torch.nn.functional as F
import soundfile as sf
from fairseq import checkpoint_utils

from transformers import (
    Wav2Vec2FeatureExtractor,
    Wav2Vec2ForPreTraining,
    Wav2Vec2Model,
)
from transformers.models.wav2vec2.modeling_wav2vec2 import _compute_mask_indices

model_path=""
wav_path=""
mask_prob=0.0
mask_length=10

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained(model_path)
model = Wav2Vec2Model.from_pretrained(model_path)

# for pretrain: Wav2Vec2ForPreTraining
# model = Wav2Vec2ForPreTraining.from_pretrained(model_path)

model = model.to(device)
model = model.half()
model.eval()

wav, sr = sf.read(wav_path)
input_values = feature_extractor(wav, return_tensors="pt").input_values
input_values = input_values.half()
input_values = input_values.to(device)

# for Wav2Vec2ForPreTraining
# batch_size, raw_sequence_length = input_values.shape
# sequence_length = model._get_feat_extract_output_lengths(raw_sequence_length)
# mask_time_indices = _compute_mask_indices((batch_size, sequence_length), mask_prob=0.0, mask_length=2)
# mask_time_indices = torch.tensor(mask_time_indices, device=input_values.device, dtype=torch.long)

with torch.no_grad():
    outputs = model(input_values)
    last_hidden_state = outputs.last_hidden_state

    # for Wav2Vec2ForPreTraining
    # outputs = model(input_values, mask_time_indices=mask_time_indices, output_hidden_states=True)
    # last_hidden_state = outputs.hidden_states[-1]

Runs of TencentGameMate chinese-wav2vec2-large on huggingface.co

9.1K
Total runs
-818
24-hour runs
-2.7K
3-day runs
-6.4K
7-day runs
-17.9K
30-day runs

More Information About chinese-wav2vec2-large huggingface.co Model

More chinese-wav2vec2-large license Visit here:

https://choosealicense.com/licenses/mit

chinese-wav2vec2-large huggingface.co

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

TencentGameMate chinese-wav2vec2-large online free

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

TencentGameMate chinese-wav2vec2-large online free url in huggingface.co:

https://huggingface.co/TencentGameMate/chinese-wav2vec2-large

chinese-wav2vec2-large install

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

chinese-wav2vec2-large install url in huggingface.co:

https://huggingface.co/TencentGameMate/chinese-wav2vec2-large

Url of chinese-wav2vec2-large

chinese-wav2vec2-large huggingface.co Url

Provider of chinese-wav2vec2-large huggingface.co

TencentGameMate
ORGANIZATIONS

Other API from TencentGameMate