Skip to content

Commit

Permalink
fix progress
Browse files Browse the repository at this point in the history
  • Loading branch information
qinxuye committed Dec 27, 2024
1 parent f2f286f commit b3f9a02
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions xinference/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit b3f9a02

Please sign in to comment.