cog
cog copied to clipboard
Replicate is failing outside my code with a pickling issue after my predict function ends
During my predict() function, I initialize a class called EachPredictor, and assign it to a dict inside the Predictor. However, every call errors after the predict function is finished, with this:
Traceback (most recent call last):
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/cog/server/worker.py", line 226, in _predict
self._events.send(PredictionOutput(payload=make_encodeable(result)))
File "/root/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/connection.py", line 206, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/root/.pyenv/versions/3.10.13/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps
cls(buf, protocol).dump(obj)
_pickle.PicklingError: Can't pickle <class 'predict.EachPredictor'>: it's not the same object as predict.EachPredictor
This was not an issue just a couple of days ago