Make cog train call trainings endpoint (#2013)
* Support different response types in _predict
* Currently _predict assumes all response types are
a PredictionResponse type.
* In the case where _predict is called by a train
endpoint this assumption is not true and we have
to use a TrainingResponse type.
* Feed in the response type to the _predict
function so it can properly deserialise training
responses.
* Make cog train CLI call /trainings
* Instead of relying on the /predictions endpoint
to be overridden directly call the /trainings
endpoint.
* Report the correct command to the user in the
event of a failure.
* Explicitly check return code in test train
* Allows better debugging of stderr et al
* Correctly set TrainingResponse type in training idempotent
* This call also requires the appropriate response
type.
* Use explicit argument index syntax in cog predict