Skip to content

Commit bda8d5d

Browse files
authored
Merge pull request #245 from roboflow/cli-upload-requests-timeout
Individual Upload timeouts
2 parents 75abcf7 + 4e5ca9f commit bda8d5d

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

roboflow/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from roboflow.models import CLIPModel, GazeModel # noqa: F401
1515
from roboflow.util.general import write_line
1616

17-
__version__ = "1.1.25"
17+
__version__ = "1.1.26"
1818

1919

2020
def check_key(api_key, model, notebook, num_retries=0):

roboflow/adapters/rfapi.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def upload_image(
7171
"file": ("imageToUpload", imgjpeg, "image/jpeg"),
7272
}
7373
)
74-
response = requests.post(upload_url, data=m, headers={"Content-Type": m.content_type})
74+
response = requests.post(upload_url, data=m, headers={"Content-Type": m.content_type}, timeout=(300, 300))
7575

7676
else:
7777
# Hosted image upload url
7878

7979
upload_url = _hosted_upload_url(api_key, project_url, image_path, split)
8080
# Get response
81-
response = requests.post(upload_url)
81+
response = requests.post(upload_url, timeout=(300, 300))
8282
responsejson = None
8383
try:
8484
responsejson = response.json()
@@ -123,6 +123,7 @@ def save_annotation(
123123
upload_url,
124124
data=json.dumps({"annotationFile": annotation_string, "labelmap": annotation_labelmap}),
125125
headers={"Content-Type": "application/json"},
126+
timeout=(60, 60),
126127
)
127128
responsejson = None
128129
try:

0 commit comments

Comments
 (0)