Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ccurme committed Sep 16, 2024
1 parent 73ebbe5 commit e40ba32
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libs/ibm/langchain_ibm/llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,15 @@ def validate_environment(cls, values: Dict) -> Any:
"""Validate that credentials and python package exists in environment."""
if isinstance(values.get("watsonx_model"), (ModelInference, Model)):
values["model_id"] = getattr(values["watsonx_model"], "model_id")
values["deployment_id"] = getattr(
values["watsonx_model"], "deployment_id", ""
values["deployment_id"] = (
getattr(values["watsonx_model"], "deployment_id", "") or ""
)
values["project_id"] = getattr(
getattr(values["watsonx_model"], "_client"),
"default_project_id",
values["project_id"] = (
getattr(
getattr(values["watsonx_model"], "_client"),
"default_project_id",
)
or ""
)
values["space_id"] = getattr(
getattr(values["watsonx_model"], "_client"), "default_space_id"
Expand Down

0 comments on commit e40ba32

Please sign in to comment.