cog
ba2f0090 - fix: add ExperimentalFeatureWarning compat shim

Commit
9 days ago
fix: add ExperimentalFeatureWarning compat shim Existing models import ExperimentalFeatureWarning to suppress warnings: from cog import ExperimentalFeatureWarning warnings.filterwarnings('ignore', category=ExperimentalFeatureWarning) This class was removed when the Python HTTP server was replaced by coglet, causing ImportError on model load. The shim provides _ExperimentalFeatureWarning (a FutureWarning subclass) via module-level __getattr__, which: - Prints a deprecation notice to stderr (cannot be swallowed by warnings.filterwarnings('ignore')) - Caches in globals() so the message fires at most once - Returns the class so existing filterwarnings() calls still work
Author
Committer
Parents
Loading