# WhisperLiveKit + 聯發科Breeze ASR 25 ## 參考來源 [WhisperLiveKit](https://github.com/QuentinFuxa/WhisperLiveKit/tree/main) [Breeze-ASR-25](https://huggingface.co/MediaTek-Research/Breeze-ASR-25) ## 設置流程 1. 首先clone案至本機 ```shell git clone https://github.com/QuentinFuxa/WhisperLiveKit.git ``` 2. 調整`Dockerfile`,加入安裝`safetensors` ``` ...(前略) # timeout/retries for large torch wheels RUN pip3 install --upgrade pip setuptools wheel && \ pip3 --disable-pip-version-check install --timeout=120 --retries=5 \ --index-url https://download.pytorch.org/whl/cu129 \ torch torchaudio \ || (echo "Initial install failed — retrying with extended timeout..." && \ pip3 --disable-pip-version-check install --timeout=300 --retries=3 \ --index-url https://download.pytorch.org/whl/cu129 \ torch torchvision torchaudio) # 加入這段 RUN pip3 install safetensors ...(後略) COPY . . ``` 3. 產出`image`,我加入`-safetensors`來做自己版本識別使用 ```shell docker build -t wlk-safetensors . ``` 4. 安裝`huggingface cli` ```shell curl -LsSf https://hf.co/cli/install.sh | bash ``` 5. 利用`huggingface cli`下載聯發科`Breeze ASR` 請注意,`--local-dir`後面請調整為你的實際保存位置 ```shell env PATH="$HOME/.local/bin:$PATH" hf download MediaTek-Research/Breeze-ASR-25 --local-dir /home/marty/large_files/Breeze-ASR-25 ``` 6. `docker run`啟動容器 data volume(`-v`) 與 port(`-p`) 的部份請根據你的實際狀況調整 ```shell docker run --rm --gpus all -p 8081:8000 -v /home/marty/large_files/Breeze-ASR-25:/models/Breeze-ASR-25 -v /home/marty/.cache/whisper:/root/.cache/whisper -v /home/marty/.cache/huggingface:/root/.cache/huggingface wlk-safetensors:latest --backend whisper --model-path /models/Breeze-ASR-25 --language zh ``` 啟動之後就會開始下載一個`base.pt`,大約130mb,然後就會看到服務啟動的訊息: ``` docker run --rm --gpus all -p 8081:8000 -v /home/marty/large_files/Breeze-ASR-25:/models/Breeze-ASR-25 -v /home/marty/.cache/whisper:/root/.cache/whisper -v /home/marty/.cache/huggingface:/root/.cache/huggingface wlk-safetensors:latest --backend whisper --model-path /models/Breeze-ASR-25 --language zh INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) ``` 這邊看到的`8000`是容器內的對應port,現在你只要打開網頁,然後連結到你啟動服務的`8081`port就可以開始測試了。 記得要有麥克風就是。
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up