-
Notifications
You must be signed in to change notification settings - Fork 693
check if log_dir is not none #2389
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
check if log_dir is not none #2389
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2389
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit a679bc4 with merge base d5d85c5 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
torchtune/training/metric_logging.py
Outdated
|
|
||
| # create log_dir if missing | ||
| if not os.path.exists(self.log_dir): | ||
| if self.log_dir and not os.path.exists(self.log_dir): |
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.
is not None
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.
A new test would be nice ...
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.
if self.log_dir works, no? Did you suggest "is not None" for readability or something else?
boooo for the test
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.
If there's a possibility it can be None, then the proper check is if x is not None
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.
I'm fine with filing a follow up for test :)
joecummings
left a comment
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.
stampy stamp
Context
What is the purpose of this PR? Is it to
if log_dir was not passed ,it would crash. This makes log_dir optonal
Test plan
Before this change:
After this change:
It works!