File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 92
92
)
93
93
from .constants import (
94
94
NUCLEUS_ENDPOINT ,
95
+ DEFAULT_NETWORK_TIMEOUT_SEC ,
95
96
ERRORS_KEY ,
96
97
ERROR_ITEMS ,
97
98
ERROR_PAYLOAD ,
@@ -658,7 +659,7 @@ def predict(
658
659
Union [BoxPrediction , PolygonPrediction , SegmentationPrediction ]
659
660
],
660
661
update : bool ,
661
- batch_size : int = 100 ,
662
+ batch_size : int = 5000 ,
662
663
):
663
664
"""
664
665
Uploads model outputs as predictions for a model_run. Returns info about the upload.
@@ -1043,6 +1044,7 @@ def _make_grequest(
1043
1044
session = sess ,
1044
1045
files = payload ,
1045
1046
auth = (self .api_key , "" ),
1047
+ timeout = DEFAULT_NETWORK_TIMEOUT_SEC ,
1046
1048
)
1047
1049
else :
1048
1050
post = requests_command (
@@ -1051,6 +1053,7 @@ def _make_grequest(
1051
1053
json = payload ,
1052
1054
headers = {"Content-Type" : "application/json" },
1053
1055
auth = (self .api_key , "" ),
1056
+ timeout = DEFAULT_NETWORK_TIMEOUT_SEC ,
1054
1057
)
1055
1058
return post
1056
1059
@@ -1074,6 +1077,7 @@ def _make_request_raw(
1074
1077
json = payload ,
1075
1078
headers = {"Content-Type" : "application/json" },
1076
1079
auth = (self .api_key , "" ),
1080
+ timeout = DEFAULT_NETWORK_TIMEOUT_SEC ,
1077
1081
)
1078
1082
logger .info ("API request has response code %s" , response .status_code )
1079
1083
Original file line number Diff line number Diff line change 1
1
NUCLEUS_ENDPOINT = "https://api.scale.com/v1/nucleus"
2
+ DEFAULT_NETWORK_TIMEOUT_SEC = 60
2
3
ITEMS_KEY = "items"
3
4
ITEM_KEY = "item"
4
5
REFERENCE_ID_KEY = "reference_id"
You can’t perform that action at this time.
0 commit comments