Skip to content

Commit

Permalink
fix: Do not import python modules from deepsearch-glm (#569)
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
  • Loading branch information
cau-git authored Dec 11, 2024
1 parent f45499c commit aee9c0b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions docling/models/ds_glm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
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 (
Expand Down Expand Up @@ -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 = ""
Expand Down

0 comments on commit aee9c0b

Please sign in to comment.