# AudioToText **Repository Path**: hubery_jun/audio-to-text ## Basic Information - **Project Name**: AudioToText - **Description**: 将音频或者视频转换为文本,采用 Whisper - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-05-05 - **Last Updated**: 2024-09-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 打包命令 ```python # 添加 FFmpeg pyinstaller --add-binary "./audio_env/Lib/site-packages/faster_whisper/assets:faster_whisper/assets" --add-data "./logs:logs" --add-data "./tools:tools" --add-data "./sources:sources" --add-data "./sources/ffmpeg.exe:." main.py # 去掉 FFmpeg,新增 zhconv pyinstaller --add-binary "./audio_env/Lib/site-packages/faster_whisper/assets:faster_whisper/assets" --add-binary "./audio_env/Lib/site-packages/zhconv/zhcdict.json:zhconv" --add-data "./logs:logs" --add-data "./tools:tools" --add-data "./sources:sources" main.py # -w 取消控制台窗口 ``` - `--add-binary` 添加二进制文件(依赖文件) - `--add-data` 添加数据文件 ## 模型下载 - https://huggingface.co/distil-whisper/distil-large-v3 - ## 问题记录 1. 在线下载 faster-whisper 模型时报错 ```python An error happened while trying to locate the file on the Hub and we cannot find the requested files in the local cache. Please check your connection and try again or make sure your Internet connection is on ``` - 原因:huggingface网站被墙了 - 解决 ```python # 方法一 # 找到文件虚拟环境 Lib\site-packages\huggingface_hub\contants.py ,先注释掉代码 ENDPOINT = os.getenv("HF_ENDPOINT") or (_HF_DEFAULT_STAGING_ENDPOINT if _staging_mode else _HF_DEFAULT_ENDPOINT) # 修改为 ENDPOINT ="https://hf-mirror.com" # 方法二:程序中设置环境变量 os.environ["HF_ENDPOINT"] = "https://hf-mirror.com" # 方法三 或者下载模型后将模型放在 `~/.cache/huggingface/hub` 目录下 ``` 2. 运行时报:`Initializing libiomp5.dylib, but found libiomp5.dylib already initialized.` ```python # 设置选项允许重复加载动态链接库 import os os.environ["KMP_DUPLICATE_LIB_OK"]="TRUE" ``` ## 界面 ![](./examples/演示.png)