hfutils.operate.base
get_hf_client
get_hf_fs
list_files_in_repository
- hfutils.operate.base.list_files_in_repository(repo_id: str, repo_type: ~typing.Literal['dataset', 'model', 'space'] = 'dataset', subdir: str = '', revision: str = 'main', ignore_patterns: ~typing.List[str] = <object object>) List[str] [source]
List files in a Hugging Face repository based on the given parameters.
- Parameters:
repo_id (str) – The identifier of the repository.
repo_type (RepoTypeTyping) – The type of the repository (‘dataset’, ‘model’, ‘space’).
subdir (str) – The subdirectory to list files from.
revision (str) – The revision of the repository (e.g., branch, tag, commit hash).
ignore_patterns (List[str]) – List of file patterns to ignore.
- Returns:
A list of file paths.
- Return type:
List[str]