broadfield-dev commited on
Commit
bd7f7f1
·
verified ·
1 Parent(s): c433896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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")