Skip to content

Commit

Permalink
fix artifacts_path type
Browse files Browse the repository at this point in the history
Signed-off-by: Michele Dolfi <[email protected]>
  • Loading branch information
dolfim-ibm committed Jan 24, 2025
1 parent 2c35b57 commit 6c3d31d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docling/models/code_formula_model.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
from pathlib import Path
from typing import Iterable, List, Literal, Optional, Tuple
from typing import Iterable, List, Literal, Optional, Tuple, Union

from docling_core.types.doc import CodeItem, DoclingDocument, NodeItem, TextItem
from docling_core.types.doc.base import BoundingBox
Expand Down Expand Up @@ -62,7 +62,7 @@ class CodeFormulaModel(BaseItemAndImageEnrichmentModel):
def __init__(
self,
enabled: bool,
artifacts_path: Optional[Path],
artifacts_path: Optional[Union[Path, str]],
options: CodeFormulaModelOptions,
accelerator_options: AcceleratorOptions,
):
Expand Down Expand Up @@ -92,6 +92,8 @@ def __init__(

if artifacts_path is None:
artifacts_path = self.download_models_hf()
else:
artifacts_path = Path(artifacts_path)

self.code_formula_model = CodeFormulaPredictor(
artifacts_path=artifacts_path,
Expand Down

0 comments on commit 6c3d31d

Please sign in to comment.