Skip to content
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

LocalFileHelper.NewWriter should create directories if necessary #23

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

jlewi
Copy link
Owner

@jlewi jlewi commented Sep 18, 2024

  • If the directories don't exist the NewWriter should create it.
  • I don't think it makes sense to make it the callers responsibility because not all filesystems (e.g. object storage) have a notion of directories so its better to make it the FileHelper's responsibility.

* If the directories don't exist the NewWriter should create it.
* I don't think it makes sense to make it the callers responsibility
  because not all filesystems (e.g. object storage) have a notion of directories
  so its better to make it the FileHelper's responsibility.
@jlewi jlewi enabled auto-merge (squash) September 18, 2024 02:59
@jlewi jlewi merged commit e0ca133 into main Sep 18, 2024
1 check passed
@jlewi jlewi deleted the jlewi/dircreate branch September 18, 2024 03:01
jlewi added a commit to jlewi/foyle that referenced this pull request Sep 18, 2024
* The bug is described in
#215 (comment)

* The bug is that `Config.getTrainingDirs` returns no training
directories if config.learner == nil
* Prior to #211 config.learner
would be non-nil because we had to set the path of the RunMe logs
* However, now that we no longer depend on RunMe logs config.learner
could be nil and this would return no training directories. In which
case learner.Reconcile would not attempt to save any examples
* The fix is to allow config.Learner to be nil in GetTrainingDirs and
return a suitable default.

We also need to ensure the training directory gets created if it doesn't
exist.
* This is fixed by jlewi/monogo#23 which updates
LocalFileHelper to create the directory if it doesn't exist.
* My suspicion is that I never hit this bug because i originally created
my ~/.foyle/training directory using a version of the code which wasn't
using FileHelper and explicitly checked and created the directory. I
suspect when I refactored the code to support saving examples to GCS
thats when the code to ensure the directory exists got dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant