mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
(feat) improve litellm verbose logs
This commit is contained in:
parent
f297a4d174
commit
1fb3547e48
1 changed files with 20 additions and 0 deletions
|
@ -8282,6 +8282,26 @@ def transform_logprobs(hf_response):
|
||||||
|
|
||||||
def print_args_passed_to_litellm(original_function, args, kwargs):
|
def print_args_passed_to_litellm(original_function, args, kwargs):
|
||||||
try:
|
try:
|
||||||
|
# we've already printed this for acompletion, don't print for completion
|
||||||
|
if (
|
||||||
|
"acompletion" in kwargs
|
||||||
|
and kwargs["acompletion"] == True
|
||||||
|
and original_function.__name__ == "completion"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
elif (
|
||||||
|
"aembedding" in kwargs
|
||||||
|
and kwargs["aembedding"] == True
|
||||||
|
and original_function.__name__ == "embedding"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
elif (
|
||||||
|
"aimg_generation" in kwargs
|
||||||
|
and kwargs["aimg_generation"] == True
|
||||||
|
and original_function.__name__ == "img_generation"
|
||||||
|
):
|
||||||
|
return
|
||||||
|
|
||||||
args_str = ", ".join(map(repr, args))
|
args_str = ", ".join(map(repr, args))
|
||||||
kwargs_str = ", ".join(f"{key}={repr(value)}" for key, value in kwargs.items())
|
kwargs_str = ", ".join(f"{key}={repr(value)}" for key, value in kwargs.items())
|
||||||
print_verbose("\n") # new line before
|
print_verbose("\n") # new line before
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue