# whisperx **Repository Path**: x1024daniel/whisperx ## Basic Information - **Project Name**: whisperx - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-15 - **Last Updated**: 2025-09-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # WhisperX推理指导 - [WhisperX推理指导](#whisperx推理指导) - [概述](#概述) - [推理环境准备](#推理环境准备) - [快速上手](#快速上手) - [获取源码](#获取源码) - [模型编译](#模型编译) - [模型推理](#模型推理) # 概述 使用mindtorch部署高性能版本的whisper-large-v2模型。 # 推理环境准备 - 当前验证环境 基础镜像: swr.cn-south-1.myhuaweicloud.com/ascendhub/mindie:2.1.RC1-800I-A2-py311-openeuler24.03-lts # 快速上手 ## 获取源码 1. Whisper large V2模型权重下载路径: ```bash mkdir whisper_pretrained https://huggingface.co/openai/whisper-large-v2/tree/main ``` 将权重文件存放至当前目录下的whisper_pretrained文件夹,请先创建改文件夹。仅以whisper_pretrained为例,用户可根据实际情况创建目录。 3. 安装依赖 ``` pip3 install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cpu pip3 install nltk pip3 install librosa pip3 install transformers==4.36.0 pip3 install numpy==1.24.0 pip3 install ml-dtypes pip3 install cloudpickle ``` 同时需要保证环境安装了libsndfile1, ffmpeg库. ## 模型推理 1. 开启cpu高性能模式进一步提升性能,开启失败不影响功能。 ``` echo performance |tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor sysctl -w vm.swappiness=0 sysctl -w kernel.numa_balancing=0 ``` 2. 安装绑核工具 ``` apt-get update apt-get install numactl ``` 查询卡的NUMA node ``` lspci -vs bus-id ``` 注:通过npu-smi info查询推理卡id对应的bus-id,然后使用上面的命令得到推理卡id对应的NUMA node。 使用lscpu指令查询NUMA node对应亲和的CPU核 ``` lscpu ``` 能够看到对应NUMA node和对应哪些cpu,例如 ``` NUMA node0 CPU(s): 0-31 NUMA node1 CPU(s): 32-63 ``` 3.绑定CPU并模型推理,假设查询到的核数为0-31 执行推理: ``` bash run.sh ```