mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
(fix) use asyncio run_in_executor
This commit is contained in:
parent
e6b5152e63
commit
f2cfb76920
1 changed files with 6 additions and 4 deletions
|
@ -2363,10 +2363,12 @@ def client(original_function):
|
||||||
threading.Thread(
|
threading.Thread(
|
||||||
target=logging_obj.success_handler, args=(result, start_time, end_time)
|
target=logging_obj.success_handler, args=(result, start_time, end_time)
|
||||||
).start()
|
).start()
|
||||||
threading.Thread(
|
|
||||||
target=logging_obj.async_success_handler,
|
loop = asyncio.get_event_loop()
|
||||||
args=(result, start_time, end_time),
|
loop.run_in_executor(
|
||||||
).start()
|
executor=None,
|
||||||
|
func=logging_obj.async_success_handler(result, start_time, end_time),
|
||||||
|
)
|
||||||
# RETURN RESULT
|
# RETURN RESULT
|
||||||
if hasattr(result, "_hidden_params"):
|
if hasattr(result, "_hidden_params"):
|
||||||
result._hidden_params["model_id"] = kwargs.get("model_info", {}).get(
|
result._hidden_params["model_id"] = kwargs.get("model_info", {}).get(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue