CoolFace
Modelpublic

Alchan/mpt-7b-chat

sourceHugging Facecc-by-nc-sa-4.0updated 2y agoView on Hugging Face
0likes89downloads
warnings.py22 linesDownload Raw Back to root
1class VersionedDeprecationWarning(DeprecationWarning):2    """A custom deprecation warning class that includes version information.3 4    Attributes:5        message (str): The deprecation message describing why the feature is deprecated.6        remove_version (str): The version in which the feature will be removed.7 8    Example:9        >>> def deprecated_function():10        ...     warnings.warn(11        ...         VersionedDeprecationWarning(12        ...             "Function XYZ is deprecated.",13        ...             after_version="2.0.0"14        ...         )15        ...     )16        ...17        >>> deprecated_function()18        DeprecationWarning: Function XYZ is deprecated. It will be removed in version 2.0.0.19    """20 21    def __init__(self, message: str, remove_version: str) -> None:22        super().__init__(message + f' It will be removed in version {remove_version}.')