Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,7 @@ async def check_n_load_attach(session: aiohttp.ClientSession, task_id
|
|
| 30 |
file_url = f"{api_url}/files/{task_id}"
|
| 31 |
try:
|
| 32 |
async with session.get(file_url, timeout=15) as response:
|
| 33 |
-
if response.status ==
|
| 34 |
|
| 35 |
# Determine file extension from Content-Type
|
| 36 |
content_type = str(response.headers.get("Content-Type", "")).lower()
|
|
@@ -109,7 +109,7 @@ async def process_question(agent, question_text: str, task_id: str, file_path: O
|
|
| 109 |
submitted_answer = None
|
| 110 |
max_retries = 5
|
| 111 |
retry_delay = 30 # Initial retry delay in seconds
|
| 112 |
-
atimeout =
|
| 113 |
|
| 114 |
for attempt in range(max_retries +1):
|
| 115 |
try:
|
|
@@ -125,7 +125,7 @@ async def process_question(agent, question_text: str, task_id: str, file_path: O
|
|
| 125 |
print(f"Completed task {task_id} with answer: {submitted_answer[:50]}...")
|
| 126 |
|
| 127 |
#Addl sleep
|
| 128 |
-
await asyncio.sleep(retry_delay)
|
| 129 |
return {"task_id": task_id, "submitted_answer": submitted_answer}
|
| 130 |
except aiohttp.ClientResponseError as e:
|
| 131 |
if e.status == 429:
|
|
|
|
| 30 |
file_url = f"{api_url}/files/{task_id}"
|
| 31 |
try:
|
| 32 |
async with session.get(file_url, timeout=15) as response:
|
| 33 |
+
if response.status == 100:
|
| 34 |
|
| 35 |
# Determine file extension from Content-Type
|
| 36 |
content_type = str(response.headers.get("Content-Type", "")).lower()
|
|
|
|
| 109 |
submitted_answer = None
|
| 110 |
max_retries = 5
|
| 111 |
retry_delay = 30 # Initial retry delay in seconds
|
| 112 |
+
atimeout = 100
|
| 113 |
|
| 114 |
for attempt in range(max_retries +1):
|
| 115 |
try:
|
|
|
|
| 125 |
print(f"Completed task {task_id} with answer: {submitted_answer[:50]}...")
|
| 126 |
|
| 127 |
#Addl sleep
|
| 128 |
+
#await asyncio.sleep(retry_delay)
|
| 129 |
return {"task_id": task_id, "submitted_answer": submitted_answer}
|
| 130 |
except aiohttp.ClientResponseError as e:
|
| 131 |
if e.status == 429:
|