fix: Do not import python modules from deepsearch-glm (#569)
Signed-off-by: Christoph Auer <cau@zurich.ibm.com>
This commit is contained in:
parent
f45499ce93
commit
aee9c0b324
@ -3,8 +3,7 @@ import random
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
|
|
||||||
from deepsearch_glm.nlp_utils import init_nlp_model
|
from deepsearch_glm.andromeda_nlp import nlp_model
|
||||||
from deepsearch_glm.utils.load_pretrained_models import load_pretrained_nlp_models
|
|
||||||
from docling_core.types.doc import BoundingBox, CoordOrigin, DoclingDocument
|
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 BoundingBox as DsBoundingBox
|
||||||
from docling_core.types.legacy_doc.base import (
|
from docling_core.types.legacy_doc.base import (
|
||||||
@ -43,9 +42,7 @@ class GlmModel:
|
|||||||
def __init__(self, options: GlmOptions):
|
def __init__(self, options: GlmOptions):
|
||||||
self.options = options
|
self.options = options
|
||||||
|
|
||||||
if self.options.model_names != "":
|
self.model = nlp_model(loglevel="error", text_ordering=True)
|
||||||
load_pretrained_nlp_models()
|
|
||||||
self.model = init_nlp_model(model_names=self.options.model_names)
|
|
||||||
|
|
||||||
def _to_legacy_document(self, conv_res) -> DsDocument:
|
def _to_legacy_document(self, conv_res) -> DsDocument:
|
||||||
title = ""
|
title = ""
|
||||||
|
Loading…
Reference in New Issue
Block a user