Skip to content

Commit

Permalink
Merge branch 'main' into profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
vishnuchalla authored Sep 19, 2024
2 parents b64a0e6 + e7302a3 commit e87e0a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions ols/app/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,10 @@ def __init__(self, data: Optional[dict] = None) -> None:
self.port = int(yaml_port)
if not 0 < self.port < 65536:
raise ValueError
except ValueError:
except ValueError as e:
raise InvalidConfigurationError(
f"invalid Redis port {yaml_port}, valid ports are integers in the (0, 65536) range"
)
) from e

self.max_memory = data.get("max_memory", constants.REDIS_CACHE_MAX_MEMORY)

Expand Down Expand Up @@ -644,11 +644,11 @@ def __init__(self, data: Optional[dict] = None) -> None:
)
if self.max_entries < 0:
raise ValueError
except ValueError:
except ValueError as e:
raise InvalidConfigurationError(
"invalid max_entries for memory conversation cache,"
" max_entries needs to be a non-negative integer"
)
) from e

def __eq__(self, other: object) -> bool:
"""Compare two objects for equality."""
Expand Down Expand Up @@ -678,10 +678,10 @@ def __init__(self, data: Optional[dict] = None) -> None:
self.replace_with = data.get("replace_with")
if self.name is None or self.pattern is None or self.replace_with is None:
raise ValueError
except ValueError:
except ValueError as e:
raise InvalidConfigurationError(
"name, pattern and replace_with need to be specified"
)
) from e

def __eq__(self, other: object) -> bool:
"""Compare two objects for equality."""
Expand All @@ -701,8 +701,8 @@ def validate_yaml(self) -> None:
raise InvalidConfigurationError("pattern is missing")
try:
re.compile(self.pattern)
except re.error:
raise InvalidConfigurationError("pattern is invalid")
except re.error as e:
raise InvalidConfigurationError("pattern is invalid") from e
if self.replace_with is None:
raise InvalidConfigurationError("replace_with is missing")

Expand Down
6 changes: 3 additions & 3 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ dependencies = [
"redis==5.0.8",
"faiss-cpu==1.8.0.post1",
"sentence-transformers==3.0.1",
"openai==1.42.0",
"openai==1.46.0",
"ibm-generative-ai==3.0.0",
"ibm-cos-sdk==2.13.6",
"langchain-openai==0.1.15",
Expand Down

0 comments on commit e87e0a9

Please sign in to comment.