Skip to content

Commit 43818af

Browse files
committed
fix(extract_thinker.markdown.markdown_converter): prevent using vision (if set False) after using it as True
1 parent 98a5eaa commit 43818af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

extract_thinker/markdown/markdown_converter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,9 +556,9 @@ def to_markdown(self, source: Union[str, IO, List[Union[str, IO]]], vision: bool
556556
# We have both LLM and DocumentLoader
557557

558558
# Configure document loader for vision if needed
559-
if vision and hasattr(self.document_loader, 'set_vision_mode'):
559+
if hasattr(self.document_loader, 'set_vision_mode'):
560560
try:
561-
self.document_loader.set_vision_mode(True)
561+
self.document_loader.set_vision_mode(vision)
562562
except Exception as e:
563563
print(f"Warning: Failed to set vision mode on document loader: {e}")
564564

@@ -697,9 +697,9 @@ def _basic_to_markdown(self, source: Union[str, IO, List[Union[str, IO]]], visio
697697
raise ValueError("Document loader is required.")
698698

699699
# Configure document loader for vision if needed and supported
700-
if vision and hasattr(self.document_loader, 'set_vision_mode'):
700+
if hasattr(self.document_loader, 'set_vision_mode'):
701701
try:
702-
self.document_loader.set_vision_mode(True)
702+
self.document_loader.set_vision_mode(vision)
703703
except Exception as e:
704704
print(f"Warning: Failed to set vision mode on document loader: {e}")
705705

0 commit comments

Comments
 (0)