From c16051cdc930ccb361746266173ff63b040c70bf Mon Sep 17 00:00:00 2001 From: Tadashi Date: Tue, 17 Dec 2024 17:05:37 +0700 Subject: [PATCH] fix: comfort precommit --- libs/ktem/ktem/app.py | 7 +++---- libs/ktem/ktem/utils/render.py | 3 ++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libs/ktem/ktem/app.py b/libs/ktem/ktem/app.py index 8eb77851..c4dce356 100644 --- a/libs/ktem/ktem/app.py +++ b/libs/ktem/ktem/app.py @@ -13,7 +13,8 @@ from theflow.settings import settings from theflow.utils.modules import import_dotted_string -BASE_PATH = os.environ.get('GRADIO_ROOT_PATH', '') +BASE_PATH = os.environ.get("GRADIO_ROOT_PATH", "") + class BaseApp: """The main app of Kotaemon @@ -56,9 +57,7 @@ def __init__(self): self._pdf_view_js = self._pdf_view_js.replace( "PDFJS_PREBUILT_DIR", pdf_js_dist_dir, - ).replace( - "GRADIO_ROOT_PATH", BASE_PATH - ) + ).replace("GRADIO_ROOT_PATH", BASE_PATH) with (dir_assets / "js" / "svg-pan-zoom.min.js").open() as fi: self._svg_js = fi.read() diff --git a/libs/ktem/ktem/utils/render.py b/libs/ktem/ktem/utils/render.py index 7a08729e..28039e90 100644 --- a/libs/ktem/ktem/utils/render.py +++ b/libs/ktem/ktem/utils/render.py @@ -5,7 +5,8 @@ from kotaemon.base import RetrievedDocument -BASE_PATH = os.environ.get('GRADIO_ROOT_PATH', '') +BASE_PATH = os.environ.get("GRADIO_ROOT_PATH", "") + def is_close(val1, val2, tolerance=1e-9): return abs(val1 - val2) <= tolerance