SpeechRecognition/fix_single_process.bat

32 lines
1012 B
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
echo ============================================================
echo 修复进程崩溃问题 - 启用单进程模式
echo ============================================================
echo.
echo 正在修改 main.py...
echo.
REM 读取文件内容并替换
powershell -Command ^
"$content = Get-Content -Path 'main.py' -Raw; ^
$content = $content -replace 'MAX_WORKERS_OVERRIDE = None', 'MAX_WORKERS_OVERRIDE = 1 # 强制单进程模式'; ^
Set-Content -Path 'main.py' -Value $content -Encoding UTF8"
echo.
echo ✓ 修改完成!
echo.
echo ============================================================
echo 已启用单进程模式
echo ============================================================
echo.
echo 现在可以运行:
echo python main.py
echo.
echo 如果需要恢复多进程模式,请编辑 main.py:
echo 找到MAX_WORKERS_OVERRIDE = 1
echo 改为MAX_WORKERS_OVERRIDE = None
echo.
echo ============================================================
pause