Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -60,7 +60,7 @@ def get_all_files(owner, repo, path="", is_hf=False):
|
|
60 |
|
61 |
def get_hf_files(repo, name):
|
62 |
"""Fetch all files from a Hugging Face Space with robust error handling."""
|
63 |
-
api = HfApi()
|
64 |
try:
|
65 |
# Use HfApi to list files, which is more reliable for Spaces
|
66 |
file_list = api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space")
|
|
|
60 |
|
61 |
def get_hf_files(repo, name):
|
62 |
"""Fetch all files from a Hugging Face Space with robust error handling."""
|
63 |
+
api = HfApi(token=os.getenv('HF_TOKEN'))
|
64 |
try:
|
65 |
# Use HfApi to list files, which is more reliable for Spaces
|
66 |
file_list = api.list_repo_files(repo_id=f'{repo}/{name}', repo_type="space")
|