2023年4月18日 星期二

[電腦] OpenAI Whisper 中文語音轉文字

因為有兩個分別一小時左右的錄音檔想做逐字稿

試著自己邊聽邊打弄了一下午進度只有一點點

所以找了一下中文語音轉文字有沒有軟體可以處理


結果查到 OpenAI 的 Whisper 可以辦得到

而且錯誤率可接受 (現在 AI 真的好厲害好好用)

https://github.com/openai/whisper


並且還有人做好教學影片


【Whisper】免費開源語音辨識自動上字幕 字幕正確率比剪映還高!!!|下載完後無

須聯網 僅需使用自己電腦處理|如何在Windows上使用Whisper

https://www.youtube.com/watch?v=kFtrvdriLU8


我自己在 Win10 的電腦照著影片中所講的來操作

的確可以中文語音轉文字

只是速度慢了點

因為這台 Win10 的電腦只有內顯沒有顯卡, 所以只能使用 CPU 來做 AI 運算


而我有 NVidia GTX 1660 Super 顯卡的電腦是 Win7

在 Win7 上安裝 Whisper 碰到了一些困難, 但已一一排除現在可以順利使用了

目前一小時的錄音檔約需兩小時的時間跑 Whisper --model medium 才能跑完


1. Windows 7 只能裝 Python 3.8.10

2. pip 要更新 (到 23 版)

   python -m pip install --upgrade pip

3. pip install -U openai-whisper

   安裝完後 --device 預設是 cpu 無法設 cuda, 所以需要做影片中的

   pip uninstall torch

   pip cache purge

4. PyTorch 的官網可以找到最新的 PyTorch https://pytorch.org/

   pip3 install torch torchvision torchaudio --index-url

   https://download.pytorch.org/whl/cu117

5. 再來會碰到 cudart64_110.dll 找不到的問題, 解決辦法在下面網頁

   https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/7379

============================================================

Cyberbeing commented on Jan 30

That is normal since the latest Windows 7 driver (474.11/474.14) is built

with CUDA 11.4 Update4, and the recent webUI update is shipping CUDA 11.7

libs.


Fortunately, NVIDIA designed CUDA 11.x with minor version compatibility, so

as you discovered all you need to do is place the CUDA 11.4 (or older)

cudart64_110.dll in your Torch folders and it will work with any CUDA 11.x

Torch distribution. For anyone who needs it, I've attached the latest Windows

7 driver compatible cudart64_110.dll.


cudart64_11.4.148.zip

============================================================

6. 將下載回來的 cudart64_110.dll 覆蓋掉原本的之後就可以讓

   whisper --device cuda 使用 GPU 運算了

沒有留言:

張貼留言