fix: reset _default_converter on init failure (H5)
If the lazy-init of the default converter fails (e.g. model download error), the singleton was left as None but subsequent calls would not retry. Now the failed state is cleared so the next request retries. Ref #57 (H5)
This commit is contained in:
parent
4b1a15f49a
commit
f89dc51661
1 changed files with 5 additions and 1 deletions
|
|
@ -118,7 +118,11 @@ def _build_docling_converter(options: ConversionOptions) -> DoclingConverter:
|
|||
def _get_default_converter() -> DoclingConverter:
|
||||
global _default_converter
|
||||
if _default_converter is None:
|
||||
_default_converter = _build_docling_converter(ConversionOptions())
|
||||
try:
|
||||
_default_converter = _build_docling_converter(ConversionOptions())
|
||||
except Exception:
|
||||
_default_converter = None
|
||||
raise
|
||||
return _default_converter
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue