MLX Transcribe 是一款使用 MLX Whisper 转写音频文件的工具。
安装 ffmpeg
brew install ffmpeg
sudo apt-get install ffmpeg
安装 mlx-whisper 库
准备音频文件
下载示例音频 (可选)
storage/audio
目录。以下 Agent 将使用 MLX Transcribe 来转写音频文件。
参数 | 类型 | 默认值 | 描述 |
---|---|---|---|
base_dir | Path | Path.cwd() | 音频文件的基础目录 |
read_files_in_base_dir | bool | True | 是否注册 read_files 函数 |
path_or_hf_repo | str | "mlx-community/whisper-large-v3-turbo" | 模型的路径或 HuggingFace 仓库 |
verbose | bool | None | 启用详细输出 |
temperature | float 或 Tuple[float, ...] | None | 采样温度 |
compression_ratio_threshold | float | None | 压缩率阈值 |
logprob_threshold | float | None | 对数概率阈值 |
no_speech_threshold | float | None | 无语音阈值 |
condition_on_previous_text | bool | None | 是否基于先前文本进行条件设置 |
initial_prompt | str | None | 转写的初始提示 |
word_timestamps | bool | None | 启用词级时间戳 |
prepend_punctuations | str | None | 在句首添加的标点符号 |
append_punctuations | str | None | 在句尾添加的标点符号 |
clip_timestamps | str 或 List[float] | None | 裁剪时间戳 |
hallucination_silence_threshold | float | None | 幻觉静默阈值 |
decode_options | dict | None | 其他解码选项 |
函数 | 描述 |
---|---|
transcribe | 使用 MLX Whisper 转写音频文件 |
read_files | 列出基础目录中的所有音频文件 |