fix - use tp executor (#7509)

This commit is contained in:
Ishaan Jaff 2025-01-02 22:25:15 -08:00 committed by GitHub
parent d861aa8ff3
commit 8bd6c977e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -915,9 +915,12 @@ def client(original_function): # noqa: PLR0915
# LOG SUCCESS - handle streaming success logging in the _next_ object, remove `handle_success` once it's deprecated
verbose_logger.info("Wrapper: Completed Call, calling success_handler")
threading.Thread(
target=logging_obj.success_handler, args=(result, start_time, end_time)
).start()
executor.submit(
logging_obj.success_handler,
result,
start_time,
end_time,
)
# RETURN RESULT
if hasattr(result, "_hidden_params"):
result._hidden_params["model_id"] = kwargs.get("model_info", {}).get(
@ -1122,11 +1125,12 @@ def client(original_function): # noqa: PLR0915
asyncio.create_task(
logging_obj.async_success_handler(result, start_time, end_time)
)
threading.Thread(
target=logging_obj.success_handler,
args=(result, start_time, end_time),
).start()
executor.submit(
logging_obj.success_handler,
result,
start_time,
end_time,
)
# REBUILD EMBEDDING CACHING
if (
isinstance(result, EmbeddingResponse)