跳到主要内容

Whisper-Tiny 示例

此文档讲述使用 QAI AppBuilder Python API 利用 Qualcomm® Hexagon™ Processor (NPU) 推理 Whisper-Tiny 语音识别模型。

示例支持设备

设备SoC
Fogwise® AIRbox Q900QCS9075

安装 QAI AppBuilder

提示
  1. 请根据 QAI AppBuilder 安装方法 安装 QAI AppBuilder。

  2. 请根据 创建 ADSP 环境变量 配置 ADSP 环境变量。

运行示例

安装依赖

在已激活的虚拟环境中安装示例依赖:

Device
pip3 install requests tqdm qai-hub py3-wget Pillow torch torchvision opencv-python-headless audio2numpy

运行脚本

  • 进入上游示例目录

    Device
    cd qai-appbuilder/samples
  • 准备输入数据(示例自带输入文件时可直接运行;也可按脚本参数指定)

input audio

  • 执行推理

    Device
    python3 audio/Speech_Recognition/whisper_tiny_en/whisper_tiny_en.py --chipset 9075

默认输入为示例自带的 jfk.wav。成功时终端会打印转写结果,例如:

Transcription: And so my fellow Americans ask not what your country can do for you, ask what you can do for your country.
提示

首次运行会通过 Qualcomm® AI Hub 自动下载 encoder/decoder 模型。解码阶段依赖 tiktoken 词表;若设备访问 openaipublic.blob.core.windows.net 失败,可先在可联网环境预热 tiktoken.get_encoding("gpt2") 缓存。

python3 run_inference.py --list
python3 run_inference.py --model whisper_tiny_en --args "--chipset 9075"

    您需要登录 GitHub 才能发表评论。如果您已登录,请忽略此消息。

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0