Upload file_utils.py with huggingface_hub
Browse files- file_utils.py +6 -3
file_utils.py
CHANGED
@@ -1,9 +1,12 @@
|
|
1 |
import os
|
|
|
2 |
|
3 |
|
4 |
-
def get_all_files_in_dir(
|
5 |
-
|
6 |
-
|
|
|
|
|
7 |
Optionally filter by file extension.
|
8 |
|
9 |
:param dir_path: The directory path to search for files.
|
|
|
1 |
import os
|
2 |
+
from typing import Optional
|
3 |
|
4 |
|
5 |
+
def get_all_files_in_dir(
|
6 |
+
dir_path: str, recursive: bool = False, file_extension: Optional[str] = None
|
7 |
+
):
|
8 |
+
"""Get all files in a directory. Optionally recursively.
|
9 |
+
|
10 |
Optionally filter by file extension.
|
11 |
|
12 |
:param dir_path: The directory path to search for files.
|