mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-02 10:45:00 +00:00
refactor: remove debug prints and add lazy litellm loading verbosity flag
This commit is contained in:
parent
d09d281a8d
commit
974e618541
2 changed files with 5 additions and 2 deletions
|
@ -12,8 +12,6 @@ if type(__version__) is not str:
|
|||
__version__ = safe_version + "+type"
|
||||
else:
|
||||
try:
|
||||
print(__version__)
|
||||
print(safe_version)
|
||||
if version.parse(__version__) < version.parse(safe_version):
|
||||
__version__ = safe_version + "+less"
|
||||
except Exception:
|
||||
|
|
|
@ -13,6 +13,8 @@ os.environ["LITELLM_MODE"] = "PRODUCTION"
|
|||
|
||||
# `import litellm` takes 1.5 seconds, defer it!
|
||||
|
||||
VERBOSE = False
|
||||
|
||||
|
||||
class LazyLiteLLM:
|
||||
_lazy_module = None
|
||||
|
@ -27,6 +29,9 @@ class LazyLiteLLM:
|
|||
if self._lazy_module is not None:
|
||||
return
|
||||
|
||||
if VERBOSE:
|
||||
print("Loading litellm...")
|
||||
|
||||
self._lazy_module = importlib.import_module("litellm")
|
||||
|
||||
self._lazy_module.suppress_debug_info = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue