From 43104e0d19c1978ec642f4e502c02ce536635f45 Mon Sep 17 00:00:00 2001 From: TerminalMan <84923604+SecretiveShell@users.noreply.github.com> Date: Sat, 31 Aug 2024 21:48:43 +0100 Subject: [PATCH 1/2] Complete conditional infinity import TODO - add logging - change declaration order --- backends/infinity/model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backends/infinity/model.py b/backends/infinity/model.py index 35a4df45..37049016 100644 --- a/backends/infinity/model.py +++ b/backends/infinity/model.py @@ -7,13 +7,13 @@ from common.utils import unwrap # Conditionally import infinity to sidestep its logger -# TODO: Make this prettier +has_infinity_emb: bool = False try: from infinity_emb import EngineArgs, AsyncEmbeddingEngine - has_infinity_emb = True + logger.debug("Successfully imported infinity.") except ImportError: - has_infinity_emb = False + logger.debug("Failed to import infinity.") class InfinityContainer: From 42a42caf430fb28423dd7df31a2d070eba16892c Mon Sep 17 00:00:00 2001 From: Jake <84923604+SecretiveShell@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:14:09 +0100 Subject: [PATCH 2/2] remove logging - remove logging statements - format code with ruff --- backends/infinity/model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backends/infinity/model.py b/backends/infinity/model.py index 37049016..c48a42c2 100644 --- a/backends/infinity/model.py +++ b/backends/infinity/model.py @@ -10,10 +10,10 @@ has_infinity_emb: bool = False try: from infinity_emb import EngineArgs, AsyncEmbeddingEngine + has_infinity_emb = True - logger.debug("Successfully imported infinity.") except ImportError: - logger.debug("Failed to import infinity.") + pass class InfinityContainer: