Skip to content

Commit

Permalink
Fixbug: UI error if oss cfg is none (#210)
Browse files Browse the repository at this point in the history
* Fixbug: when oss cfg is none

* Fixbug
  • Loading branch information
wwxxzz authored Sep 10, 2024
1 parent 365f8a6 commit 0d5cfc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/pai_rag/app/web/view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pai_rag/config/settings_multi_modal.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ name = "qwen-turbo"
source = ""

[rag.llm.multi_modal]
enable = true
enable = false
source = "DashScope"
name = "qwen-vl-max"

Expand All @@ -89,7 +89,7 @@ chunk_size = 500
chunk_overlap = 10

[rag.oss_store]
enable = true
enable = false
bucket = ""
endpoint = ""
prefix = ""
Expand Down

0 comments on commit 0d5cfc3

Please sign in to comment.