ydshieh HF Staff commited on
Commit
ce87751
·
verified ·
1 Parent(s): 1448e70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -23,6 +23,7 @@ def _list_collection_files(pr_number: str) -> Tuple[str, ...]:
23
  Return the `collection_summary.json` paths stored for a specific PR.
24
  """
25
  prefix = f"pr-{pr_number}"
 
26
  try:
27
  # List all files in the repo and filter by prefix
28
  entries = API.list_repo_tree(
@@ -35,11 +36,20 @@ def _list_collection_files(pr_number: str) -> Tuple[str, ...]:
35
  return tuple()
36
 
37
  files = []
 
38
  for entry in entries:
39
  entry_type = getattr(entry, "type", None)
 
 
 
40
  # Filter by prefix and look for collection_summary.json files
41
  if entry_type == "file" and entry.path.startswith(prefix) and entry.path.endswith("collection_summary.json"):
42
  files.append(entry.path)
 
 
 
 
 
43
  return tuple(files)
44
 
45
 
 
23
  Return the `collection_summary.json` paths stored for a specific PR.
24
  """
25
  prefix = f"pr-{pr_number}"
26
+ print(f"Looking for files with prefix: {prefix}")
27
  try:
28
  # List all files in the repo and filter by prefix
29
  entries = API.list_repo_tree(
 
36
  return tuple()
37
 
38
  files = []
39
+ matching_paths = []
40
  for entry in entries:
41
  entry_type = getattr(entry, "type", None)
42
+ # Debug: show all files that match the prefix
43
+ if entry_type == "file" and entry.path.startswith(prefix):
44
+ matching_paths.append(entry.path)
45
  # Filter by prefix and look for collection_summary.json files
46
  if entry_type == "file" and entry.path.startswith(prefix) and entry.path.endswith("collection_summary.json"):
47
  files.append(entry.path)
48
+
49
+ print(f"Found {len(matching_paths)} files with prefix {prefix}")
50
+ print(f"Found {len(files)} collection_summary.json files")
51
+ if matching_paths:
52
+ print(f"Sample matching paths: {matching_paths[:5]}")
53
  return tuple(files)
54
 
55