Skip to content

Commit

Permalink
Update jinja2 and error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ibro45 committed Jun 6, 2024
1 parent 8e73be8 commit d983a60
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lighter/utils/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def parse_config(**kwargs) -> ConfigParser:
# Ensure a config file is specified.
config = kwargs.pop("config", None)
if config is None:
raise ValueError("'--config' not specified. Exiting.")
raise ValueError("'--config' not specified. Please provide a valid configuration file.")

# Read the config file and update it with overrides.
parser = ConfigParser(CONFIG_STRUCTURE, globals=False)
Expand Down Expand Up @@ -60,7 +60,7 @@ def validate_config(parser: ConfigParser) -> None:
root_keys = parser.get().keys()
invalid_keys = set(root_keys) - set(CONFIG_STRUCTURE.keys()) - {"_meta_", "_requires_"}
if invalid_keys:
raise ValueError(f"Invalid top-level config keys: {list(invalid_keys)}. Allowed keys: {list(CONFIG_STRUCTURE.keys())}")
raise ValueError(f"Invalid top-level config keys: {invalid_keys}. Allowed keys: {CONFIG_STRUCTURE.keys()}")

# Validate that 'args' contains only valid Trainer/Tuner method names.
args_keys = parser.get("args", {}).keys()
Expand Down
6 changes: 3 additions & 3 deletions poetry.lock

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

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ requests = "^2.31.0"
monai = "^1.3.0"
rich = "^13.7.0"
torchvision = "^0.17.0"
jinja2 = "^3.1.4"

[tool.poetry.group.safety]
optional = true
Expand Down

0 comments on commit d983a60

Please sign in to comment.