whisperkit coreml

提供商argmaxinc
分类automatic-speech-recognition
许可证Apache-2.0
下载量274
星标0

简介

WhisperKit CoreML 是将 OpenAI 的 Whisper 语音识别模型针对苹果生态深度优化的版本。它通过 Core ML 框架,让模型能高效调用 iPhone、iPad 和 Mac 的 NPU(神经网络引擎),在保证识别精度几乎不打折的前提下,大幅降低了端侧运行的功耗并提升了推理速度。对于开发者来说,它解决了原版模型在 iOS/macOS 上部署时内存占用高、发热严重的问题,非常适合构建需要离线语音转文字、实时字幕或隐私敏感的本地 AI 应用,上手门槛较低,可直接集成到 Swift 项目中。

核心亮点

  • 深度适配苹果 NPU,端侧推理速度极快
  • 支持离线语音转文字,保障用户隐私
  • 低功耗运行,有效延长移动设备续航
  • Apache-2.0 协议,对商业化集成非常友好

使用方法

安装依赖
# 安装 Hugging Face transformers
pip install transformers torch
SDK 使用
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("argmaxinc/whisperkit-coreml")
tokenizer = AutoTokenizer.from_pretrained("argmaxinc/whisperkit-coreml")

Hugging Face 下载

我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 huggingface_hub:

操作指引
pip install -U huggingface_hub

命令行下载

下载完整模型库

下载完整模型库
huggingface-cli download argmaxinc/whisperkit-coreml

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)

下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download argmaxinc/whisperkit-coreml config.json --local-dir ./dir

更多命令行下载选项,可参见官方文档

SDK 下载

SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('argmaxinc/whisperkit-coreml')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://huggingface.co/argmaxinc/whisperkit-coreml

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/argmaxinc/whisperkit-coreml

模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。

PyTorch / Transformers 使用

安装 Transformers

安装 Transformers
pip install -U transformers torch

模型加载和推理

模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('argmaxinc/whisperkit-coreml')
tokenizer = AutoTokenizer.from_pretrained('argmaxinc/whisperkit-coreml')

模型下载

我们推荐使用命令行或者 ModelScope SDK 来进行模型的下载。

操作指引:在下载前,请先通过如下命令安装 ModelScope:

操作指引
pip install modelscope

命令行下载

下载完整模型库

下载完整模型库
modelscope download --model argmaxinc/whisperkit-coreml

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)

下载单个文件到指定本地文件夹(以下载 README.md 到当前路径下 dir 目录为例)
modelscope download --model argmaxinc/whisperkit-coreml README.md --local_dir ./dir

更多更丰富的命令行下载选项,可参见具体文档

SDK 下载

SDK 下载
# 模型下载
from modelscope import snapshot_download
model_dir = snapshot_download('argmaxinc/whisperkit-coreml')

Git 下载

请确保 lfs 已经被正确安装

Git 下载
git lfs install
git clone https://www.modelscope.cn/argmaxinc/whisperkit-coreml.git

如果您希望跳过 lfs 大文件下载,可以使用如下命令

跳过 LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/argmaxinc/whisperkit-coreml.git

ModelScope 模型页直接下载模型文件;无需将模型文件放在本站服务器。

Notebook 快速开发

下载并安装 ModelScope library

下载并安装 ModelScope library
pip install "modelscope[audio,cv,nlp,multi-modal,science]" -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html

模型加载和推理

模型加载和推理
from modelscope.pipelines import pipeline
from modelscope.utils.constant import Tasks

p = pipeline('text-generation', 'argmaxinc/whisperkit-coreml')

完整文档

来源: HuggingFace

---
pretty_name: WhisperKit
viewer: false
library_name: whisperkit
tags:

  • whisper

  • whisperkit

  • coreml

  • asr

  • quantized

  • automatic-speech-recognition

license: mit
---

WhisperKit

Repo

WhisperKit is part of Argmax OSS, an On-device Speech AI SDK for Apple Silicon: https://github.com/argmaxinc/argmax-oss-swift

Paper

Check out the WhisperKit paper and presentation from ICML 2025: https://icml.cc/virtual/2025/47854

Pro

For real-time transcription with speakers and custom vocabulary, check out Argmax Pro SDK: https://www.argmaxinc.com/blog/argmax-sdk-2