Sborole commited on
Commit
f49f54c
·
verified ·
1 Parent(s): 17909da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -52,6 +52,18 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
52
  print("Dataset", dataset)
53
  print("Length is ", len(dataset))
54
  print(type(dataset))
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  # 3. Run your Agent
57
  results_log = []
 
52
  print("Dataset", dataset)
53
  print("Length is ", len(dataset))
54
  print(type(dataset))
55
+ id_to_path = {}
56
+ for ex in dataset:
57
+ # Check if the example has an associated file path and name
58
+ if ex.get("file_path") and ex.get("file_name"):
59
+ full_path = os.path.join(data_dir, ex["file_path"])
60
+
61
+ # Check if the file actually exists on disk
62
+ if os.path.exists(full_path):
63
+ id_to_path[ex["task_id"]] = full_path
64
+
65
+ # The 'id_to_path' dictionary is essential for your file reading tool.
66
+ print(f"Mapped {len(id_to_path)} question IDs to resource files.")
67
 
68
  # 3. Run your Agent
69
  results_log = []