Because we now use torch.save instead of pickle.dump to serialize the model, a bug arose.
torch.save first creates a zip file, and then dumps the pickled representation of the model to that zipfile.
However, if the client requested the status of the model after the zipfile creation but before dumping the pickled content, the status endpoint would return DONE since it treated the empty zip file as the serialized model. It would then send an empty file to the client.
Therefore, if the file is empty, we should say it's still compiling.
Because we now use torch.save instead of pickle.dump to serialize the model, a bug arose.
torch.save first creates a zip file, and then dumps the pickled representation of the model to that zipfile.
However, if the client requested the status of the model after the zipfile creation but before dumping the pickled content, the status endpoint would return
DONE
since it treated the empty zip file as the serialized model. It would then send an empty file to the client.Therefore, if the file is empty, we should say it's still compiling.