Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix llm settings #243

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading