I have converted a model to a BytesIO object using joblib in the following way:
from io import BytesIO
import joblib
bytes_container = BytesIO()
joblib.dump(model, bytes_container)
bytes_container.seek(0) # update to enable reading
bytes_model = bytes_container.read()
How do I convert the bytes_model back to a model now. joblib.load asks for a filename instead of a bytestring.
I think you can just do the following:
bytes_container = BytesIO()
joblib.dump(model, bytes_container)
bytes_container.seek(0)
model = joblib.load(bytes_container)