Skip to content

Commit 5224e0d

Browse files
committed
Added poll and timeout parameters to inferences.run method
1 parent a2633fc commit 5224e0d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

modzy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
from .client import ApiClient # noqa
77
from .edge.client import EdgeClient
8-
__version__ = '0.11.5'
8+
__version__ = '0.11.6'
99

1010
logging.getLogger(__name__).addHandler(logging.NullHandler())

modzy/edge/inferences.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def perform_inference(self, model_identifier: str, model_version: str, input_sou
197197
inference_request = self.build_inference_request(model_identifier, model_version, input_sources, explain, tags)
198198
return self.client.PerformInference(inference_request)
199199

200-
def run(self, model_identifier: str, model_version: str, input_sources: List[InputSource], explain=False, tags=None) -> Inference:
200+
def run(self, model_identifier: str, model_version: str, input_sources: List[InputSource], explain=False, tags=None, poll_interval=0.01, timeout=30) -> Inference:
201201
"""
202202
Provides a synchronous way to run an inference. This is simply a convenience function that is equivalent to the `perform_inference` and `block_until_complete` methods run sequentially.
203203
@@ -229,7 +229,7 @@ def run(self, model_identifier: str, model_version: str, input_sources: List[Inp
229229
```
230230
"""
231231
inference = self.perform_inference(model_identifier, model_version, input_sources, explain, tags)
232-
return self.block_until_complete(inference.identifier)
232+
return self.block_until_complete(inference.identifier, poll_interval, timeout)
233233

234234
def get_inference_details(self, inference_identifier: str) -> Inference:
235235
'''

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@
4343
# removed in 0.7.1 test_suite='tests',
4444
# removed in 0.7.1 tests_require=test_requirements,
4545
url='https://github.com/modzy/sdk-python',
46-
version='0.11.5',
46+
version='0.11.6',
4747
zip_safe=False,
4848
)

0 commit comments

Comments
 (0)