-
Notifications
You must be signed in to change notification settings - Fork 15
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
Support pickle model import on API server #34
Conversation
|
||
else: | ||
print("model path must end with .pkl") | ||
exit(0) |
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.
We should use a non-zero exit code for errors
exit(0) | |
exit(1) |
if classifier is None: | ||
print("The classifier was not loaded") | ||
exit(0) |
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 going to delete this because it conflicts with the intention of DISABLE_CLASSIFIER
. Sometimes it is useful to start the API server without a classifier, e.g. if you just want to serve info from the sqlite DB.
If we want to simplify this in future and always require a classifier, we should remove the DISABLE_CLASSIFIER
option
if classifier is None: | |
print("The classifier was not loaded") | |
exit(0) |
Merging as-is and will push my changes in a follow-up PR |
Motivation
Using blockprint currently involves having the training data in a folder. Once the model is trained, it can be persisted, but imported back into the application.
This feature would allow anyone to use already trained models, as well as saving a lot of training time and disk space.
Description
It is needed to create a function that can import the model back, and call this from the main application.
Depending on whether the model was given or not, we shall import it.
TODOs: