From 53532a4c99ed65c6ec95c44188b40b48bdc41183 Mon Sep 17 00:00:00 2001 From: JunKeon Park Date: Mon, 10 Jun 2024 10:43:39 +0900 Subject: [PATCH] chore: Disable logging for PyPDF in layout_analysis_parsers.py --- libs/upstage/langchain_upstage/layout_analysis_parsers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/upstage/langchain_upstage/layout_analysis_parsers.py b/libs/upstage/langchain_upstage/layout_analysis_parsers.py index a19b7a9..18b017a 100644 --- a/libs/upstage/langchain_upstage/layout_analysis_parsers.py +++ b/libs/upstage/langchain_upstage/layout_analysis_parsers.py @@ -1,5 +1,6 @@ import io import json +import logging import os import warnings from typing import Dict, Iterator, List, Literal, Optional, Union @@ -10,6 +11,10 @@ from pypdf import PdfReader, PdfWriter from pypdf.errors import PdfReadError +# Disable logging for PyPDF +logger = logging.getLogger("pypdf") +logger.setLevel(logging.ERROR) + LAYOUT_ANALYSIS_URL = "https://api.upstage.ai/v1/document-ai/layout-analysis" DEFAULT_NUMBER_OF_PAGE = 10