共计 1176 个字符,预计需要花费 3 分钟才能阅读完成。
这个有点难度,而且需要 hf 的权限(语音按人分离等功能),不会申请的话有点困难。
采用 wisper(large V3)+ollama+qwen3:8b(全本地化模型)

1. 安装 Python 3.11 或更高版本
2. 打开命令行,进入源码目录
3. 创建虚拟环境:python -m venv .venv
4. 激活虚拟环境:.venv\Scripts\activate
5. 安装依赖:pip install -r requirements.txt
6. 双击「启动会议纪要助手网页端.bat」启动服务
链接:https://pan.quark.cn/s/c7fcce2a59c2
代码片段:(分项链接带源码)
def load_models():
global whisper_model, diarize_model, align_models
try:
update_server_state(status_text="正在加载语音识别模型...", loading_progress=10)
import whisperx
from whisperx.diarize import DiarizationPipeline
device = "cuda"; compute_type = "float16"
whisper_model = whisperx.load_model("large-v3", device, compute_type=compute_type)
update_server_state(status_text="正在加载说话人分离模型...", loading_progress=50)
diarize_model = DiarizationPipeline(token=os.environ.get("HF_TOKEN",""), device=device)
align_models = (None, None)
update_server_state(models_loaded=True, status_text="模型就绪", loading_progress=100)
print("模型加载完成。")
except Exception as e:
update_server_state(status_text=f"模型加载失败:{e}", loading_progress=0)
@asynccontextmanager
async def lifespan(app: FastAPI):
global app_event_loop
app_event_loop = asyncio.get_running_loop()
threading.Thread(target=load_models, daemon=True).start()
yield
torch.cuda.empty_cache()
app = FastAPI(lifespan=lifespan)
正文完
