Skip to content

Commit 7709f0c

Browse files
Remove docling core test from lean imports, add transformers back and import semchunk and transformers in chunkers.py
Signed-off-by: Aakanksha Duggal <aduggal@redhat.com>
1 parent 0376926 commit 7709f0c

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/instructlab/sdg/utils/chunkers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
)
2323
from docling_core.transforms.chunker.hybrid_chunker import HybridChunker
2424
from langchain_text_splitters import Language, RecursiveCharacterTextSplitter
25+
import semchunk
26+
import transformers
2527

2628
# First Party
2729
from instructlab.sdg.utils.model_formats import is_model_gguf, is_model_safetensors

tests/testdata/leanimports.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,11 @@
44
import sys
55

66
# block slow imports
7-
for unwanted in ["deepspeed", "llama_cpp", "torch", "vllm"]:
7+
for unwanted in ["deepspeed", "llama_cpp", "torch", "transformers", "vllm"]:
88
# importlib raises ModuleNotFound when sys.modules value is None.
99
assert unwanted not in sys.modules
1010
sys.modules[unwanted] = None # type: ignore[assignment]
1111

12-
# Try to import in your PR to see if this works around the issue. If not, print an error
13-
try:
14-
# Third Party
15-
import docling_core
16-
except ImportError as e:
17-
print(f"Could not import `docling_core` because: {e}")
18-
1912
# First Party
2013
# This will trigger errors if any of the import chain tries to load
2114
# the unwanted modules

0 commit comments

Comments
 (0)