Download warnings.py from krutrim-ai-labs/Krutrim-1-instruct: direct link, hf CLI and curl.
- Browser
- Download file 895 Bytes
-
https://huggingface.co/krutrim-ai-labs/Krutrim-1-instruct/resolve/main/warnings.py
- Command line
-
hf download hf://krutrim-ai-labs/Krutrim-1-instruct/warnings.py
-
curl -L -o warnings.py https://huggingface.co/krutrim-ai-labs/Krutrim-1-instruct/resolve/main/warnings.py
895 Bytes
| class VersionedDeprecationWarning(DeprecationWarning): | |
| """A custom deprecation warning class that includes version information. | |
| Attributes: | |
| message (str): The deprecation message describing why the feature is deprecated. | |
| remove_version (str): The version in which the feature will be removed. | |
| Example: | |
| >>> def deprecated_function(): | |
| ... warnings.warn( | |
| ... VersionedDeprecationWarning( | |
| ... "Function XYZ is deprecated.", | |
| ... remove_version="2.0.0" | |
| ... ) | |
| ... ) | |
| ... | |
| >>> deprecated_function() | |
| DeprecationWarning: Function XYZ is deprecated. It will be removed in version 2.0.0. | |
| """ | |
| def __init__(self, message: str, remove_version: str) -> None: | |
| super().__init__(message + f' It will be removed in version {remove_version}.') |