-
Notifications
You must be signed in to change notification settings - Fork 170
Fix/config path #124
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/config path #124
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,7 +16,9 @@ | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| load_dotenv(override=True) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| _config_path = os.path.join(os.environ["PROJECT_ROOT"], "models/rf3/configs") | ||||||||||||||||||||||
| _config_path = os.path.join( | ||||||||||||||||||||||
| os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "configs" | ||||||||||||||||||||||
| ) | ||||||||||||||||||||||
|
Comment on lines
+19
to
+21
|
||||||||||||||||||||||
| _config_path = os.path.join( | |
| os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "configs" | |
| ) | |
| # Prefer a sibling 'configs' directory (installed mode); fall back to the | |
| # development layout where 'configs' lives three levels up. | |
| _sibling_configs = os.path.join(os.path.dirname(__file__), "configs") | |
| _dev_configs = os.path.join( | |
| os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "configs" | |
| ) | |
| _config_path = _sibling_configs if os.path.isdir(_sibling_configs) else _dev_configs |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
|
|
||
| import pandas as pd | ||
| from beartype.typing import Any | ||
| from lightning_fabric.utilities import rank_zero_only | ||
| from lightning.fabric.utilities import rank_zero_only | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just a more modern import pattern for fabric which has been subsumed into lightning. |
||
| from omegaconf import DictConfig, OmegaConf | ||
| from rich.console import Console | ||
| from rich.syntax import Syntax | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of checking installed vs development mode is reversed compared to the RFD3 implementation pattern. This checks for installed mode first, which could cause issues if someone has the package installed and is also working in a development environment - it would use the potentially stale installed configs instead of the development ones.
Consider following the RFD3 pattern: check for the development path first, then fall back to the installed path. This ensures that when working in development mode, the development configs are always used.