🚀 俄語語音識別合併模型
本項目是基於TIES方法合併的俄語語音識別模型,使用了多個基礎模型和數據集,可用於自動語音識別(ASR)任務。
🚀 快速開始
模型信息
屬性 |
詳情 |
基礎模型 |
antony66/whisper-large-v3-russian、bond005/whisper-large-v3-ru-podlodka |
語言 |
ru(俄語) |
庫名稱 |
transformers |
標籤 |
asr、whisper、russian、mergekit、merge |
數據集 |
mozilla-foundation/common_voice_17_0、bond005/taiga_speech_v2、bond005/podlodka_speech、bond005/rulibrispeech |
評估指標 |
wer(詞錯誤率) |
新版本信息
新版本已發佈:Apel-sin/whisper-large-v3-russian-ties-podlodka-v1.2
📚 詳細文檔
模型合併細節
此模型使用TIES合併方法進行合併,具體配置如下:
method: ties
parameters:
ties_density: 0.85
encoder_weights:
- 0.65
- 0.35
decoder_weights:
- 0.6
- 0.4
models:
model_a: "/mnt/cloud/llm/whisper/whisper-large-v3-russian"
model_b: "/mnt/cloud/llm/whisper/whisper-large-v3-ru-podlodka"
output_dir: "/mnt/cloud/llm/whisper/whisper-large-v3-russian-ties-podlodka"
簡單API服務器
該模型可與簡單的OpenAI兼容API服務器一起使用:https://github.com/kreolsky/whisper-api-server/
💻 使用示例
基礎用法
為了處理電話通話,強烈建議在進行自動語音識別(ASR)之前對錄音進行預處理並調整音量。例如,可以使用以下命令:
sox record.wav -r 8000 record-normalized.wav norm -0.5 compand 0.3,1 -90,-90,-70,-50,-40,-15,0,0 -7 0 0.15
然後,ASR代碼示例如下:
import torch
from transformers import WhisperForConditionalGeneration, WhisperProcessor, pipeline
torch_dtype = torch.bfloat16
device = 'cpu'
if torch.cuda.is_available():
device = 'cuda'
elif torch.backends.mps.is_available():
device = 'mps'
setattr(torch.distributed, "is_initialized", lambda : False)
device = torch.device(device)
whisper = WhisperForConditionalGeneration.from_pretrained(
"antony66/whisper-large-v3-russian", torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True,
)
processor = WhisperProcessor.from_pretrained("antony66/whisper-large-v3-russian")
asr_pipeline = pipeline(
"automatic-speech-recognition",
model=whisper,
tokenizer=processor.tokenizer,
feature_extractor=processor.feature_extractor,
max_new_tokens=256,
chunk_length_s=30,
batch_size=16,
return_timestamps=True,
torch_dtype=torch_dtype,
device=device,
)
from io import BufferIO
wav = BytesIO()
with open('record-normalized.wav', 'rb') as f:
wav.write(f.read())
wav.seek(0)
asr = asr_pipeline(wav, generate_kwargs={"language": "russian", "max_new_tokens": 256}, return_timestamps=False)
print(asr['text'])
🔧 開發進度
目前該模型仍在開發中,目標是儘可能對其進行微調,以用於電話通話的語音識別。如果您想貢獻代碼,並且知道或擁有任何優質數據集,請告知。非常感謝您的幫助。