MCPcopy Create free account
hub / github.com/AlayaLab/Hive / _get_default_logging_level

Function _get_default_logging_level

models/flowsep/diffusers/utils/logging.py:52–66  ·  view source on GitHub ↗

If DIFFUSERS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is not - fall back to `_default_log_level`

()

Source from the content-addressed store, hash-verified

50
51
52def _get_default_logging_level():
53 """
54 If DIFFUSERS_VERBOSITY env var is set to one of the valid choices return that as the new default level. If it is
55 not - fall back to `_default_log_level`
56 """
57 env_level_str = os.getenv("DIFFUSERS_VERBOSITY", None)
58 if env_level_str:
59 if env_level_str in log_levels:
60 return log_levels[env_level_str]
61 else:
62 logging.getLogger().warning(
63 f"Unknown option DIFFUSERS_VERBOSITY={env_level_str}, "
64 f"has to be one of: { ', '.join(log_levels.keys()) }"
65 )
66 return _default_log_level
67
68
69def _get_library_name() -> str:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected