Shaltiel commited on
Commit
632db34
1 Parent(s): 02e5b77

Printing file path

Browse files
Files changed (1) hide show
  1. src/populate.py +4 -4
src/populate.py CHANGED
@@ -26,8 +26,8 @@ def get_evaluation_queue_df(save_path: str, cols: list) -> list[pd.DataFrame]:
26
  all_evals = []
27
 
28
  for entry in entries:
 
29
  if ".json" in entry:
30
- file_path = os.path.join(save_path, entry)
31
  if 'counters/' in file_path: continue
32
  with open(file_path) as fp:
33
  data = json.load(fp)
@@ -36,11 +36,11 @@ def get_evaluation_queue_df(save_path: str, cols: list) -> list[pd.DataFrame]:
36
  data[EvalQueueColumn.revision.name] = data.get("revision", "main")
37
 
38
  all_evals.append(data)
39
- elif ".md" not in entry:
40
  # this is a folder
41
- sub_entries = [e for e in os.listdir(f"{save_path}/{entry}") if not e.startswith(".")]
42
  for sub_entry in sub_entries:
43
- file_path = os.path.join(save_path, entry, sub_entry)
44
  with open(file_path) as fp:
45
  data = json.load(fp)
46
 
 
26
  all_evals = []
27
 
28
  for entry in entries:
29
+ file_path = os.path.join(save_path, entry)
30
  if ".json" in entry:
 
31
  if 'counters/' in file_path: continue
32
  with open(file_path) as fp:
33
  data = json.load(fp)
 
36
  data[EvalQueueColumn.revision.name] = data.get("revision", "main")
37
 
38
  all_evals.append(data)
39
+ elif os.path.isdir(file_path):
40
  # this is a folder
41
+ sub_entries = [e for e in os.listdir(file_path) if not e.startswith(".")]
42
  for sub_entry in sub_entries:
43
+ file_path = os.path.join(file_path, sub_entry)
44
  with open(file_path) as fp:
45
  data = json.load(fp)
46