This method is identical to `logger.warning()`, but if env var DIFFUSERS_NO_ADVISORY_WARNINGS=1 is set, this warning will not be printed
(self, *args, **kwargs)
| 266 | |
| 267 | |
| 268 | def warning_advice(self, *args, **kwargs) -> None: |
| 269 | """ |
| 270 | This method is identical to `logger.warning()`, but if env var DIFFUSERS_NO_ADVISORY_WARNINGS=1 is set, this |
| 271 | warning will not be printed |
| 272 | """ |
| 273 | no_advisory_warnings = os.getenv("DIFFUSERS_NO_ADVISORY_WARNINGS", False) |
| 274 | if no_advisory_warnings: |
| 275 | return |
| 276 | self.warning(*args, **kwargs) |
| 277 | |
| 278 | |
| 279 | logging.Logger.warning_advice = warning_advice |
nothing calls this directly
no outgoing calls
no test coverage detected