Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -116,9 +116,6 @@ def get_hf_files(repo, name):
|
|
116 |
print(f"Processed files: {processed_files}")
|
117 |
return processed_files
|
118 |
|
119 |
-
'''except HfApiError as e:
|
120 |
-
print(f"Hugging Face API error for {repo}/{name}: {str(e)}")
|
121 |
-
return []'''
|
122 |
except Exception as e:
|
123 |
print(f"Error processing Hugging Face files for {repo}/{name}: {str(e)}")
|
124 |
return []
|
@@ -133,9 +130,7 @@ def get_repo_contents(url):
|
|
133 |
try:
|
134 |
api = HfApi()
|
135 |
api.list_repo_files(repo_id=f'{owner}/{repo}', repo_type="space") # Pre-check
|
136 |
-
|
137 |
-
raise Exception(f"Hugging Face Space not found or inaccessible: {str(e)}")'''
|
138 |
-
|
139 |
files = get_hf_files(owner, repo)
|
140 |
if not files: # Empty list is valid, but check for errors
|
141 |
raise Exception("No files found in the Hugging Face Space")
|
|
|
116 |
print(f"Processed files: {processed_files}")
|
117 |
return processed_files
|
118 |
|
|
|
|
|
|
|
119 |
except Exception as e:
|
120 |
print(f"Error processing Hugging Face files for {repo}/{name}: {str(e)}")
|
121 |
return []
|
|
|
130 |
try:
|
131 |
api = HfApi()
|
132 |
api.list_repo_files(repo_id=f'{owner}/{repo}', repo_type="space") # Pre-check
|
133 |
+
|
|
|
|
|
134 |
files = get_hf_files(owner, repo)
|
135 |
if not files: # Empty list is valid, but check for errors
|
136 |
raise Exception("No files found in the Hugging Face Space")
|