Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,12 +170,12 @@ def create_solutions(image_urls, names):
|
|
| 170 |
return solutions
|
| 171 |
|
| 172 |
def send_results_to_api(solutions, url):
|
| 173 |
-
headers = {"Content-Type": "application/json"}
|
| 174 |
try:
|
| 175 |
logging.info(f"Sending results to API at {url} with data: {solutions}")
|
| 176 |
# response = requests.patch(url, json = {"solutions":solutions}) # Set a timeout headers=headers,, timeout=60
|
| 177 |
data = {"solutions":solutions}
|
| 178 |
-
response = requests.patch(url, data=json.dumps(data), headers=headers
|
| 179 |
response.raise_for_status()
|
| 180 |
logging.info(f"Response from API: {response.text}")
|
| 181 |
return response.json()
|
|
|
|
| 170 |
return solutions
|
| 171 |
|
| 172 |
def send_results_to_api(solutions, url):
|
| 173 |
+
# headers = {"Content-Type": "application/json"}
|
| 174 |
try:
|
| 175 |
logging.info(f"Sending results to API at {url} with data: {solutions}")
|
| 176 |
# response = requests.patch(url, json = {"solutions":solutions}) # Set a timeout headers=headers,, timeout=60
|
| 177 |
data = {"solutions":solutions}
|
| 178 |
+
response = requests.patch(url, data=json.dumps(data)) #, headers=headers
|
| 179 |
response.raise_for_status()
|
| 180 |
logging.info(f"Response from API: {response.text}")
|
| 181 |
return response.json()
|