Skip to content

Commit

Permalink
fix llm settings (#243)
Browse files Browse the repository at this point in the history
Co-authored-by: Yue Fei <[email protected]>
  • Loading branch information
Ceceliachenen and moria97 authored Oct 14, 2024
1 parent dfd1ff7 commit 7ca5a00
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/pai_rag/app/web/view_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ def from_app_config(config):
)
if view_model.llm.lower() == "paieas":
view_model.llm_eas_model_name = config["llm"].get(
"name", view_model.llm_eas_model_name
"model_name", view_model.llm_eas_model_name
)
else:
view_model.llm_api_model_name = config["llm"].get(
"name", view_model.llm_api_model_name
"model_name", view_model.llm_api_model_name
)

view_model.use_mllm = config["llm"]["multi_modal"].get(
Expand All @@ -233,14 +233,14 @@ def from_app_config(config):
"view_model.mllm_eas_model_name",
view_model.mllm_eas_model_name,
"2",
config["llm"]["multi_modal"]["name"],
config["llm"]["multi_modal"]["model_name"],
)
view_model.mllm_eas_model_name = config["llm"]["multi_modal"].get(
"name", view_model.mllm_eas_model_name
"model_name", view_model.mllm_eas_model_name
)
else:
view_model.mllm_api_model_name = config["llm"]["multi_modal"].get(
"name", view_model.mllm_api_model_name
"model_name", view_model.mllm_api_model_name
)

view_model.use_oss = config["oss_store"].get("enable", view_model.use_oss)
Expand Down Expand Up @@ -446,19 +446,19 @@ def to_app_config(self):
config["llm"]["api_key"] = self.llm_api_key
config["llm"]["temperature"] = self.llm_temperature
if self.llm.lower() == "paieas":
config["llm"]["name"] = self.llm_eas_model_name
config["llm"]["model_name"] = self.llm_eas_model_name
else:
config["llm"]["name"] = self.llm_api_model_name
config["llm"]["model_name"] = self.llm_api_model_name

config["llm"]["multi_modal"]["enable"] = self.use_mllm
config["llm"]["multi_modal"]["source"] = self.mllm
config["llm"]["multi_modal"]["endpoint"] = self.mllm_eas_url
config["llm"]["multi_modal"]["token"] = self.mllm_eas_token
config["llm"]["multi_modal"]["api_key"] = self.mllm_api_key
if self.mllm.lower() == "paieas":
config["llm"]["multi_modal"]["name"] = self.mllm_eas_model_name
config["llm"]["multi_modal"]["model_name"] = self.mllm_eas_model_name
else:
config["llm"]["multi_modal"]["name"] = self.mllm_api_model_name
config["llm"]["multi_modal"]["model_name"] = self.mllm_api_model_name

config["oss_store"]["enable"] = self.use_oss
if os.getenv("OSS_ACCESS_KEY_ID") is None and self.oss_ak:
Expand Down

0 comments on commit 7ca5a00

Please sign in to comment.