-
-
Notifications
You must be signed in to change notification settings - Fork 377
[GSK-1617] ModelCache does not load cached results correctly on Windows #1335
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
Conversation
GSK-1617 Bug with ModelCache on Windows
Model cache fails on Windows with regression models, breaking all models. |
| self.model_type = model_type | ||
| self._warmed_up = False | ||
|
|
||
| def warm_up_from_disk(self): |
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.
Why not warm up at creation time instead of read_from_cache ?
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.
Because I don’t want to warm up if the cache is disabled. But it’s still better to create the ModelCache object in the model, so that it can be used if the cache is enabled at a later time.
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 think in case cache is disabled the cleanest will be not to initialize _cache property at all and then warm it up in the ModelCache constructor depending on a cache type (in memory only vs FS backed), WDYT?
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.
But cache can be disabled temporarily. So if we don’t initialize the _cache property at all, we would need to check if it exists at every prediction, initializing it there and possibly warm it up at prediction time, in addition to checking that cache is enabled. That’s because cache could have been disabled when model was initialized, but enabled later.
In any case I would avoid doing expensive and persistent operations upon construction of the instance.
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.
ok let's keep it this way
|
Kudos, SonarCloud Quality Gate passed! |








This is caused by bad formatting of newlines in csv read/write, see here.
Fixing also a series of other issues: