国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

openai開源的whisper在huggingface中使用例子(語音轉(zhuǎn)文字中文)

這篇具有很好參考價值的文章主要介紹了openai開源的whisper在huggingface中使用例子(語音轉(zhuǎn)文字中文)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

openai開源的語音轉(zhuǎn)文字支持多語言在huggingface中使用例子。
目前發(fā)現(xiàn)多語言模型large-v2支持中文是繁體,因此需要繁體轉(zhuǎn)簡體。
后續(xù)編寫微調(diào)訓練例子

GitHub地址:
https://github.com/openai/whisper

!pip install zhconv
!pip install whisper
!pip install tqdm
!pip install ffmpeg-python
!pip install transformers
!pip install librosa

from transformers import WhisperProcessor, WhisperForConditionalGeneration

import librosa
import torch
from zhconv import convert
import warnings

warnings.filterwarnings("ignore")

audio_file = f"test.wav"
#load audio file
audio, sampling_rate = librosa.load(audio_file, sr=16_000)

# # audio
# display.Audio(audio_file, autoplay=True)

# load model and processor
processor = WhisperProcessor.from_pretrained("openai/whisper-large-v2")
model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v2")
tokenizer = WhisperProcessor.from_pretrained("openai/whisper-large-v2")

processor.save_pretrained("openai/model/whisper-large-v2")
model.save_pretrained("openai/model/whisper-large-v2")
tokenizer.save_pretrained("openai/model/whisper-large-v2")

processor = WhisperProcessor.from_pretrained("openai/model/whisper-large-v2")
model = WhisperForConditionalGeneration.from_pretrained("openai/model/whisper-large-v2")
tokenizer = WhisperProcessor.from_pretrained("openai/model/whisper-large-v2")


# load dummy dataset and read soundfiles
# ds = load_dataset("common_voice", "fr", split="test", streaming=True)
# ds = ds.cast_column("audio", datasets.Audio(sampling_rate=16_000))
# input_speech = next(iter(ds))["audio"]["array"]
model.config.forced_decoder_ids = processor.get_decoder_prompt_ids(language="zh", task="transcribe")
input_features = processor(audio, return_tensors="pt").input_features
predicted_ids = model.generate(input_features)
# transcription = processor.batch_decode(predicted_ids)

transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(transcription)
print('轉(zhuǎn)化為簡體結(jié)果:', convert(transcription, 'zh-cn'))
It is strongly recommended to pass the `sampling_rate` argument to this function. Failing to do so can result in silent errors that might be hard to debug.


['啟動開始錄音']
轉(zhuǎn)化為簡體結(jié)果: 啟動開始錄音
input_features = processor(audio, return_tensors="pt").input_features
predicted_ids = model.generate(input_features)
# transcription = processor.batch_decode(predicted_ids)

transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
print(transcription)
print('轉(zhuǎn)化為簡體結(jié)果:', convert(transcription, 'zh-cn'))
It is strongly recommended to pass the `sampling_rate` argument to this function. Failing to do so can result in silent errors that might be hard to debug.


['啟動開始錄音']
轉(zhuǎn)化為簡體結(jié)果: 啟動開始錄音
#長文本如下
#使用參考網(wǎng)站:https://huggingface.co/openai/whisper-large-v2

openai開源的whisper在huggingface中使用例子(語音轉(zhuǎn)文字中文)文章來源地址http://www.zghlxwxcb.cn/news/detail-505214.html

到了這里,關(guān)于openai開源的whisper在huggingface中使用例子(語音轉(zhuǎn)文字中文)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔相關(guān)法律責任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • OpenAI又一神器!Whisper 語音轉(zhuǎn)文字手把手教程

    OpenAI又一神器!Whisper 語音轉(zhuǎn)文字手把手教程

    語音轉(zhuǎn)文字在許多不同領(lǐng)域都有著廣泛的應(yīng)用。以下是一些例子: 1.字幕制作:語音轉(zhuǎn)文字可以幫助視頻制作者快速制作字幕,這在影視行業(yè)和網(wǎng)絡(luò)視頻領(lǐng)域非常重要。通過使用語音轉(zhuǎn)文字工具,字幕制作者可以更快地生成字幕,從而縮短制作時間,節(jié)省人工成本,并提高制

    2024年02月09日
    瀏覽(21)
  • OpenAI 開源語音識別 Whisper

    OpenAI 開源語音識別 Whisper

    ????????Whisper是一個通用語音識別模型。它是在各種音頻的大型數(shù)據(jù)集上訓練的,也是一個多任務(wù)模型,可以執(zhí)行多語言語音識別以及語音翻譯和語言識別。???????? ???????人工智能公司 OpenAI?擁有 GTP-3 語言模型,并為 GitHub Copilot 提供技術(shù)支持的 ,宣布開源了

    2024年02月09日
    瀏覽(111)
  • Whisper OpenAI開源語音識別模型

    Whisper 是一個自動語音識別(ASR,Automatic Speech Recognition)系統(tǒng),OpenAI 通過從網(wǎng)絡(luò)上收集了 68 萬小時的多語言(98 種語言)和多任務(wù)(multitask)監(jiān)督數(shù)據(jù)對 Whisper 進行了訓練。OpenAI 認為使用這樣一個龐大而多樣的數(shù)據(jù)集,可以提高對口音、背景噪音和技術(shù)術(shù)語的識別能力。除

    2024年02月16日
    瀏覽(95)
  • 語音識別開源框架 openAI-whisper

    Whisper 是一種通用的語音識別模型。 它是OpenAI于2022年9月份開源的在各種音頻的大型數(shù)據(jù)集上訓練的語音識別模型,也是一個可以執(zhí)行多語言語音識別、語音翻譯和語言識別的多任務(wù)模型。 GitHub - yeyupiaoling/Whisper-Finetune: 微調(diào)Whisper語音識別模型和加速推理,支持Web部署和Andr

    2024年02月17日
    瀏覽(96)
  • whisper 強大且開源的語音轉(zhuǎn)文字

    whisper 強大且開源的語音轉(zhuǎn)文字

    說起來語音轉(zhuǎn)換文字,openai旗下的whisper很是好用,推理也很快,同時支持cpu和GPU。 GitHub:GitHub - openai/whisper: Robust Speech Recognition via Large-Scale Weak Supervision 相關(guān)的參數(shù)和內(nèi)存使用如下: Size Parameters English-only model Multilingual model Required VRAM Relative speed tiny 39 M tiny.en tiny ~1 GB ~32x

    2024年02月10日
    瀏覽(20)
  • OpenAI開源??!Whisper語音識別實戰(zhàn)!!【環(huán)境配置+代碼實現(xiàn)】

    OpenAI開源!!Whisper語音識別實戰(zhàn)?。 经h(huán)境配置+代碼實現(xiàn)】

    目錄 環(huán)境配置 代碼實現(xiàn) ******? 實現(xiàn) .mp4轉(zhuǎn)換為 .wav文件,識別后進行匹配并輸出出現(xiàn)的次數(shù) ******? 完整代碼實現(xiàn)請私信 安裝 ffmpeg 打開網(wǎng)址? ?https://github.com/BtbN/FFmpeg-Builds/releases 下載如下圖所示的文件 下載后解壓 ?我的路徑是G:ffmpeg-master-latest-win64-gpl-shared

    2024年02月13日
    瀏覽(24)
  • 可以白嫖的語音識別開源項目whisper的搭建詳細過程 | 如何在Linux中搭建OpenAI開源的語音識別項目Whisper

    可以白嫖的語音識別開源項目whisper的搭建詳細過程 | 如何在Linux中搭建OpenAI開源的語音識別項目Whisper

    原文來自我個人的博客。 服務(wù)器為GPU服務(wù)器。點擊這里跳轉(zhuǎn)到我使用的GPU服務(wù)器。我搭建 whisper 選用的是 NVIDIA A 100顯卡,4GB顯存。 Python版本要在3.8~3.11之間。 輸入下面命令查看使用的Python版本。 為啥要安裝Anaconda? 為了減少不同項目使用的庫的版本沖突,我們可以使用An

    2024年02月09日
    瀏覽(19)
  • chatGPT的耳朵!OpenAI的開源語音識別AI:Whisper !

    chatGPT的耳朵!OpenAI的開源語音識別AI:Whisper !

    語音識別是通用人工智能的重要一環(huán)!可以說是AI的耳朵! 它可以讓機器理解人類的語音,并將其轉(zhuǎn)換為文本或其他形式的輸出。 語音識別的應(yīng)用場景非常廣泛,比如智能助理、語音搜索、語音翻譯、語音輸入等等。 然而,語音識別也面臨著很多挑戰(zhàn),比如不同的語言、口

    2024年03月14日
    瀏覽(26)
  • OpenAI開源全新解碼器和語音識別模型Whisper-v3

    OpenAI開源全新解碼器和語音識別模型Whisper-v3

    在11月7日OpenAI的首屆開發(fā)者大會上,除了推出一系列重磅產(chǎn)品之外,還開源了兩款產(chǎn)品,全新解碼器Consistency Decoder(一致性解碼器)和最新語音識別模型Whisper v3。 據(jù)悉,Consistency Decoder可以替代Stable Diffusion VAE解碼器。該解碼器可以改善所有與Stable Diffusion 1.0+ VAE兼容的圖像,

    2024年02月05日
    瀏覽(91)
  • OpenAI開源語音識別模型Whisper在Windows系統(tǒng)的安裝詳細過程

    OpenAI開源語音識別模型Whisper在Windows系統(tǒng)的安裝詳細過程

    Python的安裝很簡單,點擊這里進行下載。 安裝完成之后,輸入python -V可以看到版本信息,說明已經(jīng)安裝成功了。 如果輸入python -V命令沒有看到上面的這樣的信息,要么是安裝失敗,要么是安裝好之后沒有自動配置環(huán)境變量,如何配置環(huán)境變量可以從網(wǎng)上搜索。 Python的具體安

    2024年02月08日
    瀏覽(89)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包