Merge branch 'main' into shared-tasks
This commit is contained in:
commit
bb5e91969d
1 changed files with 5 additions and 4 deletions
|
|
@ -1,16 +1,17 @@
|
||||||
from docling.document_converter import DocumentConverter
|
from docling.document_converter import DocumentConverter
|
||||||
from src.utils.logging_config import get_logger
|
import logging
|
||||||
|
|
||||||
logger = get_logger(__name__)
|
logging.basicConfig(level=logging.INFO)
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
logger.info("Warming up docling models")
|
logger.info("Warming up docling models")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Use the sample document to warm up docling
|
# Use the sample document to warm up docling
|
||||||
test_file = "/app/warmup_ocr.pdf"
|
test_file = "/app/warmup_ocr.pdf"
|
||||||
logger.info("Using test file to warm up docling", test_file=test_file)
|
logger.info(f"Using test file to warm up docling: {test_file}")
|
||||||
DocumentConverter().convert(test_file)
|
DocumentConverter().convert(test_file)
|
||||||
logger.info("Docling models warmed up successfully")
|
logger.info("Docling models warmed up successfully")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.info("Docling warm-up completed with exception", error=str(e))
|
logger.info(f"Docling warm-up completed with exception: {str(e)}")
|
||||||
# This is expected - we just want to trigger the model downloads
|
# This is expected - we just want to trigger the model downloads
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue