Skip to content

Commit be8bf55

Browse files
committed
just putting this in to save it
1 parent 479959e commit be8bf55

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/groundlight/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,14 @@ def wait_for_ml_result(self, image_query: Union[ImageQuery, str], timeout_sec: f
10721072
:meth:`get_image_query` for checking result status without blocking
10731073
:meth:`wait_for_confident_result` for waiting until a confident result is available
10741074
"""
1075+
if isinstance(image_query, ImageQuery):
1076+
if image_query.result and image_query.result.source and image_query.result.source == Source.EDGE:
1077+
logger.debug(
1078+
"The image query is from the edge, so we are returning it immediately and not waiting for an ML "
1079+
"result."
1080+
)
1081+
return image_query
1082+
# TODO I think this is lying - it doesn't raise a TimeoutError if there is no ML result within timeout_sec
10751083
return self._wait_for_result(image_query, condition=iq_is_answered, timeout_sec=timeout_sec)
10761084

10771085
def _wait_for_result(

0 commit comments

Comments
 (0)