Mustafa-albakkar commited on
Commit
b7bcb6e
·
verified ·
1 Parent(s): 1a96bea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -56,7 +56,7 @@ SPACE_ID = os.getenv("SPACE_ID", "")
56
  CODE_AGENT_SPACE = os.getenv("CODE_AGENT_SPACE", "https://mustafa-albakkar-codeagent.hf.space")
57
  VISION_AGENT_SPACE = os.getenv("VISION_AGENT_SPACE", "https://mustafa-albakkar-mediaagent.hf.space")
58
  FINAL_ANSWER_SPACE = os.getenv("FINAL_ANSWER_SPACE", "https://mustafa-albakkar-finalagent.hf.space")
59
- GAIA_API_BASE = os.getenv("GAIA_API_BASE","https://agents-course-unit4-scoring.hf.space")
60
  import time
61
  from functools import wraps
62
  from requests.adapters import HTTPAdapter
@@ -261,12 +261,12 @@ class GaiaRunner:
261
  return final_out
262
 
263
  def run_all_and_submit(self) -> Dict[str, Any]:
264
- # questions_url =f"{GAIA_API_BASE}/questions"
265
  submit_url =f"{GAIA_API_BASE}/submit"
266
- # print(f"Fetching questions from: {questions_url}")
267
- # max_retries = 10 # عدد المحاولات (كل 10 ثوانٍ تقريبًا = دقيقة ونصف كحد أقصى)
268
  # for attempt in range(max_retries):
269
-
270
  # 2. Fetch Questions (بدلاً من الطلب من السبيس الخارجية)
271
  print("Fetching questions directly from GAIA dataset on Hugging Face...")
272
 
@@ -293,9 +293,10 @@ class GaiaRunner:
293
  except Exception as e:
294
  print(f"Error loading GAIA dataset directly: {e}")
295
  return f"Error loading GAIA dataset directly: {e}", None
296
- # response = requests.get(questions_url, timeout=15)
297
- # if response.status_code == 200:
298
- # questions_data = response.json()
 
299
  # if questions_data:
300
  # print(f"✅ Successfully fetched {len(questions_data)} questions.")
301
  # break
 
56
  CODE_AGENT_SPACE = os.getenv("CODE_AGENT_SPACE", "https://mustafa-albakkar-codeagent.hf.space")
57
  VISION_AGENT_SPACE = os.getenv("VISION_AGENT_SPACE", "https://mustafa-albakkar-mediaagent.hf.space")
58
  FINAL_ANSWER_SPACE = os.getenv("FINAL_ANSWER_SPACE", "https://mustafa-albakkar-finalagent.hf.space")
59
+ GAIA_API_BASE = os.getenv("GAIA_API_BASE","https://mustafa-albakkar-mmo.hf.space")
60
  import time
61
  from functools import wraps
62
  from requests.adapters import HTTPAdapter
 
261
  return final_out
262
 
263
  def run_all_and_submit(self) -> Dict[str, Any]:
264
+ questions_url =f"{GAIA_API_BASE}/questions"
265
  submit_url =f"{GAIA_API_BASE}/submit"
266
+ print(f"Fetching questions from: {questions_url}")
267
+ max_retries = 10 # عدد المحاولات (كل 10 ثوانٍ تقريبًا = دقيقة ونصف كحد أقصى)
268
  # for attempt in range(max_retries):
269
+ """
270
  # 2. Fetch Questions (بدلاً من الطلب من السبيس الخارجية)
271
  print("Fetching questions directly from GAIA dataset on Hugging Face...")
272
 
 
293
  except Exception as e:
294
  print(f"Error loading GAIA dataset directly: {e}")
295
  return f"Error loading GAIA dataset directly: {e}", None
296
+ """
297
+ response = requests.get(questions_url, timeout=15)
298
+ if response.status_code == 200:
299
+ questions_data = response.json()
300
  # if questions_data:
301
  # print(f"✅ Successfully fetched {len(questions_data)} questions.")
302
  # break