gblazex commited on
Commit
b9687ed
·
1 Parent(s): 9e5373d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
app.py CHANGED
@@ -30,12 +30,24 @@ from src.populate import get_evaluation_queue_df, get_leaderboard_df
30
  from src.submission.submit import add_new_eval
31
 
32
 
 
 
 
 
 
 
 
 
 
 
33
  from huggingface_hub import hf_hub_download, Repository
34
 
35
  def download_dataset(repo_id, local_dir):
36
  # Clone the repository
37
  repo_id_full = f"https://huggingface.co/datasets/{repo_id}"
38
  repo = Repository(local_dir=local_dir, clone_from=repo_id_full)
 
 
39
  # Alternatively, you can download specific files using hf_hub_download
40
  # file_path = hf_hub_download(repo_id, filename="your_file_name")
41
 
 
30
  from src.submission.submit import add_new_eval
31
 
32
 
33
+
34
+ import os
35
+
36
+ def count_files_in_directory_tree(directory):
37
+ file_count = 0
38
+ for root, dirs, files in os.walk(directory):
39
+ file_count += len(files)
40
+ return file_count
41
+
42
+
43
  from huggingface_hub import hf_hub_download, Repository
44
 
45
  def download_dataset(repo_id, local_dir):
46
  # Clone the repository
47
  repo_id_full = f"https://huggingface.co/datasets/{repo_id}"
48
  repo = Repository(local_dir=local_dir, clone_from=repo_id_full)
49
+ files_cnt = count_files_in_directory_tree(local_dir)
50
+ print(f"{local_dir}: {files_cnt}")
51
  # Alternatively, you can download specific files using hf_hub_download
52
  # file_path = hf_hub_download(repo_id, filename="your_file_name")
53