From b3f9a0295f0bafb989fb9a2f5802c295ae6c19b2 Mon Sep 17 00:00:00 2001 From: qinxuye Date: Fri, 27 Dec 2024 16:42:15 +0800 Subject: [PATCH] fix progress --- xinference/core/utils.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/xinference/core/utils.py b/xinference/core/utils.py index 278c570b20..6f9470107c 100644 --- a/xinference/core/utils.py +++ b/xinference/core/utils.py @@ -62,12 +62,16 @@ def decorator(func): @wraps(func) async def wrapped(*args, **kwargs): - try: - bound_args = sig.bind_partial(*args, **kwargs) - arguments = bound_args.arguments - except TypeError: - arguments = {} - request_id_str = arguments.get("request_id", "") + request_id_str = kwargs.get("request_id") + if not request_id_str: + # sometimes `request_id` not in kwargs + # we try to bind the arguments + try: + bound_args = sig.bind_partial(*args, **kwargs) + arguments = bound_args.arguments + except TypeError: + arguments = {} + request_id_str = arguments.get("request_id", "") if not request_id_str: request_id_str = uuid.uuid1() if func_name == "text_to_image":