Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -409,7 +409,7 @@ HTML_CONTENT = """
|
|
409 |
const progressContainer = document.getElementById('progressContainer');
|
410 |
const loadingSpinner = document.getElementById('loadingSpinner');
|
411 |
const resultContainer = document.getElementById('resultContainer');
|
412 |
-
|
413 |
const modal = document.getElementById('embedModal');
|
414 |
const span = document.getElementsByClassName("close")[0];
|
415 |
const embedLinkInput = document.getElementById('embedLink');
|
@@ -751,7 +751,7 @@ async def upload_chunk(upload_url: str, chunk_content: bytes, start_byte: int, e
|
|
751 |
try:
|
752 |
headers = {
|
753 |
'Content-Type': 'application/octet-stream',
|
754 |
-
|
755 |
}
|
756 |
response = requests.put(upload_url, data=chunk_content, headers=headers)
|
757 |
return response.status_code in [200, 201, 204]
|
@@ -770,7 +770,7 @@ async def retry_upload(upload_url: str, file_content: bytes, content_type: str,
|
|
770 |
except Exception as e:
|
771 |
print(f"Error during upload attempt {retries + 1}: {e}")
|
772 |
|
773 |
-
|
774 |
await asyncio.sleep(delay)
|
775 |
delay = min(delay * 2, 60) # Exponential backoff, capped at 60 seconds
|
776 |
|
|
|
409 |
const progressContainer = document.getElementById('progressContainer');
|
410 |
const loadingSpinner = document.getElementById('loadingSpinner');
|
411 |
const resultContainer = document.getElementById('resultContainer');
|
412 |
+
const dropZone = document.getElementById('dropZone');
|
413 |
const modal = document.getElementById('embedModal');
|
414 |
const span = document.getElementsByClassName("close")[0];
|
415 |
const embedLinkInput = document.getElementById('embedLink');
|
|
|
751 |
try:
|
752 |
headers = {
|
753 |
'Content-Type': 'application/octet-stream',
|
754 |
+
'Content-Range': f'bytes {start_byte}-{end_byte}/{total_size}'
|
755 |
}
|
756 |
response = requests.put(upload_url, data=chunk_content, headers=headers)
|
757 |
return response.status_code in [200, 201, 204]
|
|
|
770 |
except Exception as e:
|
771 |
print(f"Error during upload attempt {retries + 1}: {e}")
|
772 |
|
773 |
+
retries += 1
|
774 |
await asyncio.sleep(delay)
|
775 |
delay = min(delay * 2, 60) # Exponential backoff, capped at 60 seconds
|
776 |
|