def dump_object(data): # converts whatever to string s = BytesIO() joblib.dump(data, s) return s.getvalue()