Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1290,7 +1290,7 @@ def zip_files_in_folder(directory, output_zip):
|
|
1290 |
if file.endswith(".pdf") and os.path.isfile(file_path):
|
1291 |
# Add file to the ZIP archive
|
1292 |
zipf.write(file_path, file) # Save with its filename in the ZIP
|
1293 |
-
print(f"ZIP file created: {output_zip}")
|
1294 |
|
1295 |
def directory_exists(repo_id, directory, token):
|
1296 |
try:
|
@@ -1306,6 +1306,12 @@ def directory_exists(repo_id, directory, token):
|
|
1306 |
print(f"Error checking directory existence: {e}")
|
1307 |
return False
|
1308 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1309 |
css = """
|
1310 |
|
1311 |
/* Example of custom button styling */
|
|
|
1290 |
if file.endswith(".pdf") and os.path.isfile(file_path):
|
1291 |
# Add file to the ZIP archive
|
1292 |
zipf.write(file_path, file) # Save with its filename in the ZIP
|
1293 |
+
print(f"ZIP file created: {output_zip}, {file_path}, {file}")
|
1294 |
|
1295 |
def directory_exists(repo_id, directory, token):
|
1296 |
try:
|
|
|
1306 |
print(f"Error checking directory existence: {e}")
|
1307 |
return False
|
1308 |
|
1309 |
+
def get_download_link(file_path):
|
1310 |
+
# Hugging Face Spaces uses this URL format for repository-hosted files
|
1311 |
+
base_url = "https://huggingface.co/spaces/<your-space-id>/blob/main"
|
1312 |
+
# Replace <your-space-id> with your actual Space name
|
1313 |
+
return f"{base_url}/{file_path}"
|
1314 |
+
|
1315 |
css = """
|
1316 |
|
1317 |
/* Example of custom button styling */
|