replicate / cog

Containers for machine learning
https://cog.run
Apache License 2.0
8.07k stars 561 forks source link

Document that multiple predict() calls should be independent #350

Open andreasjansson opened 2 years ago

andreasjansson commented 2 years ago

Several users have wound up with bugs when predict() hasn't cleaned up completely after returning.

For example, a video generation model might write frames to a folder. If that folder isn't cleared out after returning, the next predict() call will append frames to the previous prediction's frames.

The long-term solution is to enforce isolation between predict() calls in code, but for now we should at least put a big warning sign up explaining that for now it's the user's responsibility to clean up between predict() calls.

bfirsh commented 2 years ago

Interesting. I wonder how we can enforce isolation...