OCR 500: GPU 回退 CPU、返回详细错误、增加 test-ocr 诊断。

This commit is contained in:
dekun
2026-06-28 15:04:33 +08:00
parent edd3e80ef1
commit 0d4861fa62
5 changed files with 115 additions and 24 deletions
+2 -1
View File
@@ -177,7 +177,8 @@ def _process_wrong_question(question_id: uuid.UUID):
if "libGL" in str(exc):
msg += " 请在服务器执行: sudo bash deploy/install-ocr-deps.sh && systemctl restart grade-archive"
elif ocr_url:
msg += f" 请检查 OCR 服务是否可达: {ocr_url} (可浏览器访问 {ocr_url.rstrip('/')}/health"
if "OCR 服务" not in msg:
msg += " 诊断: bash deploy/ocr-screen.sh status && bash deploy/ocr-worker/test-ocr.sh"
wq.error_message = msg
db.commit()
return