From 365f8a6755dfb91b5aaa85833a423a7779bd5485 Mon Sep 17 00:00:00 2001 From: Yue Fei Date: Tue, 10 Sep 2024 15:07:39 +0800 Subject: [PATCH 1/2] fix default trace handler (#209) --- src/pai_rag/core/rag_trace.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pai_rag/core/rag_trace.py b/src/pai_rag/core/rag_trace.py index fa881de9..0d551999 100644 --- a/src/pai_rag/core/rag_trace.py +++ b/src/pai_rag/core/rag_trace.py @@ -24,6 +24,8 @@ def init_trace(trace_config): service_owner_sub_id="", ) logger.info(f"Pai-LLM-Trace enabled with endpoint: '{trace_config.endpoint}'.") - else: + elif trace_config is not None and trace_config.type == "arize_phoenix": set_global_handler("arize_phoenix") logger.info("Arize trace enabled.") + else: + logger.warning("No trace used.") From 0d5cfc3e522798109dfd7107a1bdb9ac3072f7b4 Mon Sep 17 00:00:00 2001 From: wwxxzz Date: Tue, 10 Sep 2024 16:04:36 +0800 Subject: [PATCH 2/2] Fixbug: UI error if oss cfg is none (#210) * Fixbug: when oss cfg is none * Fixbug --- src/pai_rag/app/web/view_model.py | 8 ++++---- src/pai_rag/config/settings_multi_modal.toml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pai_rag/app/web/view_model.py b/src/pai_rag/app/web/view_model.py index dcc50733..67f8d868 100644 --- a/src/pai_rag/app/web/view_model.py +++ b/src/pai_rag/app/web/view_model.py @@ -444,13 +444,13 @@ def to_app_config(self): config["llm"]["multi_modal"]["name"] = self.mllm_api_model_name config["oss_store"]["enable"] = self.use_oss - if os.getenv("OSS_ACCESS_KEY_ID") is None: + if os.getenv("OSS_ACCESS_KEY_ID") is None and self.oss_ak: os.environ["OSS_ACCESS_KEY_ID"] = self.oss_ak - if os.getenv("OSS_ACCESS_KEY_SECRET") is None: + if os.getenv("OSS_ACCESS_KEY_SECRET") is None and self.oss_sk: os.environ["OSS_ACCESS_KEY_SECRET"] = self.oss_sk - if "***" not in self.oss_ak: + if self.oss_ak and "***" not in self.oss_ak: config["oss_store"]["ak"] = self.oss_ak - if "***" not in self.oss_sk: + if self.oss_sk and "***" not in self.oss_sk: config["oss_store"]["sk"] = self.oss_sk config["oss_store"]["endpoint"] = self.oss_endpoint config["oss_store"]["bucket"] = self.oss_bucket diff --git a/src/pai_rag/config/settings_multi_modal.toml b/src/pai_rag/config/settings_multi_modal.toml index 3ddc9b05..e279b8c4 100644 --- a/src/pai_rag/config/settings_multi_modal.toml +++ b/src/pai_rag/config/settings_multi_modal.toml @@ -71,7 +71,7 @@ name = "qwen-turbo" source = "" [rag.llm.multi_modal] -enable = true +enable = false source = "DashScope" name = "qwen-vl-max" @@ -89,7 +89,7 @@ chunk_size = 500 chunk_overlap = 10 [rag.oss_store] -enable = true +enable = false bucket = "" endpoint = "" prefix = ""