From 6129c9a56d52ebb060417cb397e0764cdd8791bc Mon Sep 17 00:00:00 2001 From: liferoad Date: Mon, 7 Oct 2024 11:05:34 -0400 Subject: [PATCH 1/2] allow numpy 2.1.x --- sdks/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/setup.py b/sdks/python/setup.py index 721cb4c1a8dd..6ce7cfdfd556 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -366,7 +366,7 @@ def get_portability_package_data(): 'jsonpickle>=3.0.0,<4.0.0', # numpy can have breaking changes in minor versions. # Use a strict upper bound. - 'numpy>=1.14.3,<1.27.0', # Update pyproject.toml as well. + 'numpy>=1.14.3,<2.2.0', # Update pyproject.toml as well. 'objsize>=0.6.1,<0.8.0', 'packaging>=22.0', 'pymongo>=3.8.0,<5.0.0', From b8accd2583c6b89acf03fcdeccf13895ae77ef0c Mon Sep 17 00:00:00 2001 From: liferoad Date: Mon, 7 Oct 2024 16:49:37 -0400 Subject: [PATCH 2/2] fixed the mypy --- sdks/python/apache_beam/ml/inference/tensorrt_inference.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdks/python/apache_beam/ml/inference/tensorrt_inference.py b/sdks/python/apache_beam/ml/inference/tensorrt_inference.py index b38947b494c2..9563aa05232a 100644 --- a/sdks/python/apache_beam/ml/inference/tensorrt_inference.py +++ b/sdks/python/apache_beam/ml/inference/tensorrt_inference.py @@ -125,7 +125,7 @@ def __init__(self, engine: trt.ICudaEngine): # TODO(https://github.com/NVIDIA/TensorRT/issues/2557): # Clean up when fixed upstream. try: - _ = np.bool # type: ignore + _ = np.bool except AttributeError: # numpy >= 1.24.0 np.bool = np.bool_ # type: ignore @@ -258,7 +258,7 @@ def __init__( model_copies: The exact number of models that you would like loaded onto your machine. This can be useful if you exactly know your CPU or GPU capacity and want to maximize resource utilization. - max_batch_duration_secs: the maximum amount of time to buffer + max_batch_duration_secs: the maximum amount of time to buffer a batch before emitting; used in streaming contexts. kwargs: Additional arguments like 'engine_path' and 'onnx_path' are currently supported. 'env_vars' can be used to set environment variables