mirror of
https://github.com/NicolasBohn/NexQuant.git
synced 2026-08-01 09:27:43 +00:00
print head for txt files and shuffle when sample (#603)
This commit is contained in:
@@ -4,6 +4,7 @@ import shutil
|
||||
from collections import Counter, defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from tqdm import tqdm
|
||||
|
||||
@@ -287,6 +288,7 @@ def create_debug_data(
|
||||
|
||||
# Use a greedy strategy to select groups so that the total number of files is as close as possible to num_to_keep
|
||||
total_files = 0
|
||||
np.random.shuffle(not_used_files)
|
||||
for nf in not_used_files:
|
||||
if total_files > num_to_keep:
|
||||
break
|
||||
|
||||
@@ -179,7 +179,7 @@ def describe_data_folder(folder_path, indent=0, max_files=2, partial_expand_subf
|
||||
|
||||
# Print the folder and its contents
|
||||
for file_type, count in files_count.items():
|
||||
if count > max_files and file_type not in ["csv", "md"]:
|
||||
if count > max_files and file_type not in ["csv", "md", "txt"]:
|
||||
result.append(" " * indent + f"{count} {file_type}s:")
|
||||
for file, size, path in files_details[file_type]:
|
||||
result.append(" " * (indent + 2) + f"- {file} ({size} bytes)")
|
||||
|
||||
Reference in New Issue
Block a user