mirror of
https://github.com/docling-project/docling-serve.git
synced 2025-11-30 09:03:19 +00:00
fix: properly load models at boot (#244)
Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
@@ -3,6 +3,8 @@ import logging
|
||||
import uuid
|
||||
from typing import Optional
|
||||
|
||||
from docling.datamodel.base_models import InputFormat
|
||||
|
||||
from docling_serve.datamodel.convert import ConvertDocumentsOptions
|
||||
from docling_serve.datamodel.task import Task, TaskSource
|
||||
from docling_serve.docling_conversion import get_converter, get_pdf_pipeline_opts
|
||||
@@ -54,4 +56,5 @@ class AsyncLocalOrchestrator(BaseAsyncOrchestrator):
|
||||
async def warm_up_caches(self):
|
||||
# Converter with default options
|
||||
pdf_format_option = get_pdf_pipeline_opts(ConvertDocumentsOptions())
|
||||
get_converter(pdf_format_option)
|
||||
converter = get_converter(pdf_format_option)
|
||||
converter.initialize_pipeline(InputFormat.PDF)
|
||||
|
||||
Reference in New Issue
Block a user