SergeyO7 commited on
Commit
85a353e
·
verified ·
1 Parent(s): ea2fd4b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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 == 200:
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 = 200
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: