Download separately
This commit is contained in:
@@ -18,10 +18,15 @@ services:
|
|||||||
command:
|
command:
|
||||||
- |
|
- |
|
||||||
# Download Chinese OCR models if missing (first run only)
|
# Download Chinese OCR models if missing (first run only)
|
||||||
if [ ! -f /opt/app-root/src/.cache/docling/models/EasyOcr/zh_sim_g2.pth ] || [ ! -f /opt/app-root/src/.cache/docling/models/EasyOcr/zh_tra_g2.pth ]; then
|
# Note: ch_sim and ch_tra are mutually exclusive, must download separately
|
||||||
echo "Downloading Chinese OCR models (Simplified + Traditional)..."
|
if [ ! -f /opt/app-root/src/.cache/docling/models/EasyOcr/zh_sim_g2.pth ]; then
|
||||||
python3 -c "import easyocr; easyocr.Reader(['en','ch_sim','ch_tra'], gpu=False)"
|
echo "Downloading Simplified Chinese OCR model..."
|
||||||
# Copy downloaded models to correct location
|
python3 -c "import easyocr; easyocr.Reader(['en','ch_sim'], gpu=False)"
|
||||||
|
cp -n /opt/app-root/src/.EasyOCR/model/*.pth /opt/app-root/src/.cache/docling/models/EasyOcr/ 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
if [ ! -f /opt/app-root/src/.cache/docling/models/EasyOcr/zh_tra_g2.pth ]; then
|
||||||
|
echo "Downloading Traditional Chinese OCR model..."
|
||||||
|
python3 -c "import easyocr; easyocr.Reader(['en','ch_tra'], gpu=False)"
|
||||||
cp -n /opt/app-root/src/.EasyOCR/model/*.pth /opt/app-root/src/.cache/docling/models/EasyOcr/ 2>/dev/null || true
|
cp -n /opt/app-root/src/.EasyOCR/model/*.pth /opt/app-root/src/.cache/docling/models/EasyOcr/ 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
exec uvicorn docling_serve.app:app --host 0.0.0.0 --port 5001
|
exec uvicorn docling_serve.app:app --host 0.0.0.0 --port 5001
|
||||||
|
|||||||
Reference in New Issue
Block a user