schuderer/mllaunchpad

CLI API and prediction should use local predict function instead of pickled one

schuderer opened this issue · 1 comments

Right now, when debugging and trying out prediction code, you have to re-train the model every time, which is cumbersome and potentially time consuming.

This is because the predict code used has been pickled/unpickled with the model_wrapper (user's implementation of ModelInterface), so if the user changes the code after training, this has no effect on any predictions they could try out.

On the command line (which is mainly for debugging after all), we need the possibility to have -api and -predict use the current prediction code instead of the pickled code.

Not sure whether we should simply do this all the time on the CLI, or add a dev or so option.

Come to think of it, should we maybe always use the out-of-pickle implementation of predict, even outside of the CLI?

Decided (for now) to keep using the pickled prediction functionality in the WSGI app (seems sensible as it makes the app more "atomic").
The command line predict and api commands will use the "live" (non-pickled) prediction code