We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0501ae4 commit a5c2f3eCopy full SHA for a5c2f3e
people-and-planet-ai/image-classification/predict.py
@@ -21,6 +21,8 @@
21
from google.cloud.aiplatform.gapic.schema import predict
22
import requests
23
24
+from train_model import with_retries
25
+
26
27
def run(
28
project: str, region: str, model_endpoint_id: str, image_file: str
@@ -43,7 +45,7 @@ def run(
43
45
)
44
46
47
base_url = "https://lilablobssc.blob.core.windows.net/wcs-unzipped"
- image_bytes = requests.get(f"{base_url}/{image_file}").content
48
+ image_bytes = with_retries(lambda: requests.get(f"{base_url}/{image_file}").content)
49
50
response = client.predict(
51
endpoint=client.endpoint_path(
0 commit comments