Abbasid commited on
Commit
7168e8d
·
verified ·
1 Parent(s): 0e1e580

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -181,6 +181,9 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
181
  questions_data = response.json()
182
  print(f"Fetched {len(questions_data)} questions.")
183
 
 
 
 
184
  # DEBUG: Print format of each question
185
  print("\n=== QUESTION FORMATS DEBUG ===")
186
  for i, item in enumerate(questions_data):
@@ -189,8 +192,6 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
189
  print("-" * 50)
190
  print("=== END DEBUG ===\n")
191
 
192
- except Exception as e:
193
- return f"Error fetching questions: {e}", pd.DataFrame()
194
 
195
  # 3. Run your Agent
196
  results_log, answers_payload = [], []
@@ -207,7 +208,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
207
  # Get file URL if it exists
208
  file_url = f"{DEFAULT_API_URL}/files/{task_id}" if item.get("has_file") else None
209
 
210
- if file_url = None:
211
  print ("No File Url")
212
  # Create structured prompt with robust file analysis
213
  structured_prompt = create_structured_prompt(question_text, file_url)
 
181
  questions_data = response.json()
182
  print(f"Fetched {len(questions_data)} questions.")
183
 
184
+ except Exception as e:
185
+ return f"Error fetching questions: {e}", pd.DataFrame()
186
+
187
  # DEBUG: Print format of each question
188
  print("\n=== QUESTION FORMATS DEBUG ===")
189
  for i, item in enumerate(questions_data):
 
192
  print("-" * 50)
193
  print("=== END DEBUG ===\n")
194
 
 
 
195
 
196
  # 3. Run your Agent
197
  results_log, answers_payload = [], []
 
208
  # Get file URL if it exists
209
  file_url = f"{DEFAULT_API_URL}/files/{task_id}" if item.get("has_file") else None
210
 
211
+ if file_url is None:
212
  print ("No File Url")
213
  # Create structured prompt with robust file analysis
214
  structured_prompt = create_structured_prompt(question_text, file_url)