Spaces:
Runtime error
Runtime error
Update file download logic in app.py to use task_id for constructing download URLs, while enhancing logging to include associated file names.
Browse files
app.py
CHANGED
@@ -88,10 +88,10 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
88 |
|
89 |
if file_name:
|
90 |
# Construct download URL and local file path
|
91 |
-
#
|
92 |
-
download_url = f"{api_url}/files/{
|
93 |
local_file_path = os.path.join(DOWNLOAD_DIR, file_name)
|
94 |
-
print(f"Attempting to download file for task {task_id}: {file_name} from {download_url}")
|
95 |
try:
|
96 |
file_response = requests.get(download_url, stream=True, timeout=30)
|
97 |
file_response.raise_for_status()
|
|
|
88 |
|
89 |
if file_name:
|
90 |
# Construct download URL and local file path
|
91 |
+
# File is identified by task_id on the server, but saved locally with its original file_name
|
92 |
+
download_url = f"{api_url}/files/{task_id}" # Changed from file_name to task_id
|
93 |
local_file_path = os.path.join(DOWNLOAD_DIR, file_name)
|
94 |
+
print(f"Attempting to download file for task {task_id} (associated file name: {file_name}) from {download_url}")
|
95 |
try:
|
96 |
file_response = requests.get(download_url, stream=True, timeout=30)
|
97 |
file_response.raise_for_status()
|