From 2bb6e681443fd02c1fef426682dde34ddc457542 Mon Sep 17 00:00:00 2001 From: xunbu Date: Sun, 11 May 2025 12:06:28 +0800 Subject: [PATCH] small fix --- .idea/workspace.xml | 11 +++-------- docutranslate/utils/convert.py | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 305bc7c..63d96f0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,12 +5,7 @@ - - - - - - + @@ -382,7 +377,7 @@ - + diff --git a/docutranslate/utils/convert.py b/docutranslate/utils/convert.py index 39db194..987ec45 100644 --- a/docutranslate/utils/convert.py +++ b/docutranslate/utils/convert.py @@ -6,7 +6,7 @@ from docling_core.types.doc import ImageRefMode from pathlib import Path from docling.document_converter import DocumentConverter, PdfFormatOption from docling.datamodel.document import DocumentStream - +from docutranslate.logger import translater_logger IMAGE_RESOLUTION_SCALE = 4 @@ -25,7 +25,7 @@ def file2markdown_embed_images(file_path: Path | str|DocumentStream, formula=Fal try: result = converter.convert(file_path).document.export_to_markdown(image_mode=ImageRefMode.EMBEDDED) except LocalEntryNotFoundError: - print(f"无法连接huggingface,正在尝试换源") + translater_logger.info(f"无法连接huggingface,正在尝试换源") os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com' result = converter.convert(file_path).document.export_to_markdown(image_mode=ImageRefMode.EMBEDDED) return result