Spaces:
Runtime error
Runtime error
Set timeout for connection
Browse files
server.py
CHANGED
@@ -66,7 +66,7 @@ def check_significance_send_task(model_a_path, model_b_path):
|
|
66 |
'model_a': model_a_fp,
|
67 |
'model_b': model_b_fp,
|
68 |
}
|
69 |
-
response = requests.post(url, files=files)
|
70 |
|
71 |
# check response
|
72 |
if response.status_code == 202:
|
@@ -81,7 +81,7 @@ def check_significance_send_task(model_a_path, model_b_path):
|
|
81 |
|
82 |
def check_significance_wait_for_result(result_url):
|
83 |
while True:
|
84 |
-
response = requests.get(result_url)
|
85 |
if response.status_code == 200:
|
86 |
result = response.json()
|
87 |
break
|
|
|
66 |
'model_a': model_a_fp,
|
67 |
'model_b': model_b_fp,
|
68 |
}
|
69 |
+
response = requests.post(url, files=files, timeout=60 * 5)
|
70 |
|
71 |
# check response
|
72 |
if response.status_code == 202:
|
|
|
81 |
|
82 |
def check_significance_wait_for_result(result_url):
|
83 |
while True:
|
84 |
+
response = requests.get(result_url, timeout=60 * 5)
|
85 |
if response.status_code == 200:
|
86 |
result = response.json()
|
87 |
break
|