mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 18:15:33 +00:00
fix(setup,docs): write INSTALL_TESSERACT from setup.ps1, correct the OCR upgrade note
setup.ps1 wrote OCR_ENABLED=true but never INSTALL_TESSERACT=true, so a Windows user answering yes to the OCR question ended up with OCR on and no engine in the image; it also claimed tesseract was "shipped in the Docker image", which this change makes false, and offered OCR for the pre-built Docker Hub images that cannot include it. Mirror setup.sh: skip the question for hub images (naming all three settings the DeepSeek path needs), and bake tesseract in for locally built ones. The upgrade callout said earlier images always included tesseract. They never did -- they included docling, and OCR ran on the RapidOCR engine bundled with it, needing no system package. It also covered only OCR_ENABLED, missing OCR_ATTACHMENTS_ENABLED, which is a separate switch onto the same native OCR path.
This commit is contained in:
1 parent
6276158d0d
commit
2a9a02427f
2 files changed
+22
-8
No files matched your search
@@ -72,10 +72,12 @@ there, point `OCR_ENGINE=deepseek` at a DeepSeek-OCR endpoint or install
|
||||
unaffected).
|
||||
|
||||
<Callout type="warning" emoji="⚠️">
|
||||
**Upgrading:** earlier images always included tesseract. If your deployment
|
||||
runs `OCR_ENABLED=true` with the `tesseract` engine, add
|
||||
`INSTALL_TESSERACT=true` to `.env` before rebuilding, or OCR of scanned pages
|
||||
stops working after the rebuild.
|
||||
**Upgrading:** earlier images always included docling, and OCR ran through the
|
||||
RapidOCR engine bundled with it, so no system package was needed. The default
|
||||
image now ships neither docling nor tesseract. If your deployment uses the
|
||||
`tesseract` engine (the default) with `OCR_ENABLED=true` or
|
||||
`OCR_ATTACHMENTS_ENABLED=true`, add `INSTALL_TESSERACT=true` to `.env` before
|
||||
rebuilding, or OCR of scanned pages stops working after the rebuild.
|
||||
</Callout>
|
||||
|
||||
## Installing the docling engine
|
||||
|
||||
@@ -508,16 +508,28 @@ function Configure-DocProcessing {
|
||||
Write-ColorText "PDF-as-image parsing enabled." -ForegroundColor "Green"
|
||||
}
|
||||
|
||||
# OCR needs the tesseract binary, an optional system package that only
|
||||
# locally built images can include (INSTALL_TESSERACT build arg). The
|
||||
# pre-built Docker Hub images ship without it, so there OCR stays off
|
||||
# (its default) rather than being switched on to fail on every scan.
|
||||
if ($COMPOSE_FILE -ne $COMPOSE_FILE_LOCAL) {
|
||||
Write-ColorText "OCR for scanned PDFs and images stays off: the pre-built Docker Hub images do not include tesseract. To use OCR, rerun setup and choose option 5 (build images locally), or use a DeepSeek-OCR endpoint by adding OCR_ENABLED=true, OCR_ENGINE=deepseek and OCR_DEEPSEEK_URL=<endpoint> to .env." -ForegroundColor "Yellow"
|
||||
return
|
||||
}
|
||||
|
||||
$ocr_enabled = Read-Host "Enable OCR for scanned PDFs and images? (y/N)"
|
||||
if ($ocr_enabled -eq "y" -or $ocr_enabled -eq "Y") {
|
||||
"OCR_ENABLED=true" | Add-Content -Path $ENV_FILE -Encoding utf8
|
||||
Write-ColorText "OCR enabled (tesseract, shipped in the Docker image; set OCR_ENGINE=deepseek for a DeepSeek-OCR endpoint)." -ForegroundColor "Green"
|
||||
# Bakes tesseract into the locally built images (docker compose
|
||||
# --env-file .env build).
|
||||
"INSTALL_TESSERACT=true" | Add-Content -Path $ENV_FILE -Encoding utf8
|
||||
Write-ColorText "OCR enabled. tesseract will be built into the images (INSTALL_TESSERACT=true); set OCR_ENGINE=deepseek in .env for a DeepSeek-OCR endpoint instead." -ForegroundColor "Green"
|
||||
$docling_ocr = Read-Host "Also install the Docling layout engine for OCR (better tables/reading order, several GB heavier)? (y/N)"
|
||||
if ($docling_ocr -eq "y" -or $docling_ocr -eq "Y") {
|
||||
# Honoured by locally built images (docker compose --env-file .env build);
|
||||
# pre-built Docker Hub images do not include docling.
|
||||
# Locally built images include docling via this build arg; it becomes
|
||||
# the OCR backend automatically (OCR_BACKEND=auto).
|
||||
"INSTALL_DOCLING=true" | Add-Content -Path $ENV_FILE -Encoding utf8
|
||||
Write-ColorText "Docling will be built into locally built images (pre-built Docker Hub images are unaffected)." -ForegroundColor "Green"
|
||||
Write-ColorText "Docling will be built into locally built images (docker compose --env-file .env build). Pre-built Docker Hub images do not include it." -ForegroundColor "Green"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user