From aee9c0b324a07190ad03ad3a6266e76c465d4cdf Mon Sep 17 00:00:00 2001 From: Christoph Auer <60343111+cau-git@users.noreply.github.com> Date: Wed, 11 Dec 2024 12:29:06 +0100 Subject: [PATCH] fix: Do not import python modules from deepsearch-glm (#569) Signed-off-by: Christoph Auer --- docling/models/ds_glm_model.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docling/models/ds_glm_model.py b/docling/models/ds_glm_model.py index 1ed347d..be0cf48 100644 --- a/docling/models/ds_glm_model.py +++ b/docling/models/ds_glm_model.py @@ -3,8 +3,7 @@ import random from pathlib import Path from typing import List, Union -from deepsearch_glm.nlp_utils import init_nlp_model -from deepsearch_glm.utils.load_pretrained_models import load_pretrained_nlp_models +from deepsearch_glm.andromeda_nlp import nlp_model from docling_core.types.doc import BoundingBox, CoordOrigin, DoclingDocument from docling_core.types.legacy_doc.base import BoundingBox as DsBoundingBox from docling_core.types.legacy_doc.base import ( @@ -43,9 +42,7 @@ class GlmModel: def __init__(self, options: GlmOptions): self.options = options - if self.options.model_names != "": - load_pretrained_nlp_models() - self.model = init_nlp_model(model_names=self.options.model_names) + self.model = nlp_model(loglevel="error", text_ordering=True) def _to_legacy_document(self, conv_res) -> DsDocument: title = ""