Spaces:
Running
Running
Commit
·
a4f1c95
1
Parent(s):
75e5313
Update index.html
Browse files- index.html +7 -26
index.html
CHANGED
@@ -81,30 +81,12 @@
|
|
81 |
}
|
82 |
|
83 |
try {
|
84 |
-
// upload files
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
while (start < file.size) {
|
92 |
-
const chunk = file.slice(start, end);
|
93 |
-
chunk.name = `${file.name}.chunk${index}`; // chunk naming convention
|
94 |
-
start = end;
|
95 |
-
end = start + chunkSize;
|
96 |
-
index++;
|
97 |
-
|
98 |
-
await uploadFiles({
|
99 |
-
repo: REPO_ID,
|
100 |
-
credentials: { accessToken: HF_ACCESS_TOKEN },
|
101 |
-
files: [{ path: chunk.name, content: chunk }],
|
102 |
-
});
|
103 |
-
|
104 |
-
// update progress bar
|
105 |
-
progressBar.value = (start / file.size) * 100;
|
106 |
-
}
|
107 |
-
}
|
108 |
|
109 |
console.log(`All files uploaded successfully`);
|
110 |
|
@@ -125,8 +107,7 @@
|
|
125 |
let time5GB = (5 * 1024 / speed) / 60;
|
126 |
let time10GB = (10 * 1024 / speed) / 60;
|
127 |
|
128 |
-
|
129 |
-
messageDiv.innerHTML = `All files uploaded successfully in ${elapsedTime.toFixed(2)} seconds, for all ${totalSize.toFixed(2)} MB in the ${files.length} files, speed ${speed.toFixed(2)} MB/s. <br> To upload a 1GB model at this speed, it would take approximately ${time1GB.toFixed(2)} minutes. <br> To upload a 5GB model at this speed, it would take approximately ${time5GB.toFixed(2)} minutes. <br> To upload a 10GB model at this speed, it would take approximately ${time10GB.toFixed(2)} minutes.`;
|
130 |
processingMessage.textContent = "All files processed";
|
131 |
} else {
|
132 |
messageDiv.textContent = 'Please select files to upload';
|
|
|
81 |
}
|
82 |
|
83 |
try {
|
84 |
+
// upload files
|
85 |
+
await uploadFiles({
|
86 |
+
repo: REPO_ID,
|
87 |
+
credentials: { accessToken: HF_ACCESS_TOKEN },
|
88 |
+
files: files.map(file => ({path: file.name, content: file}))
|
89 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
|
91 |
console.log(`All files uploaded successfully`);
|
92 |
|
|
|
107 |
let time5GB = (5 * 1024 / speed) / 60;
|
108 |
let time10GB = (10 * 1024 / speed) / 60;
|
109 |
|
110 |
+
messageDiv.innerHTML = `All files uploaded successfully in ${elapsedTime.toFixed(2)} seconds, for all ${totalSize.toFixed(2)} MB in the ${files.length} files, speed ${speed.toFixed(2)} MB/s.<br>To upload a 1GB model at this speed, it would take approximately ${time1GB.toFixed(2)} minutes.<br>To upload a 5GB model at this speed, it would take approximately ${time5GB.toFixed(2)} minutes.<br>To upload a 10GB model at this speed, it would take approximately ${time10GB.toFixed(2)} minutes.`;
|
|
|
111 |
processingMessage.textContent = "All files processed";
|
112 |
} else {
|
113 |
messageDiv.textContent = 'Please select files to upload';
|