Spaces:
Running
Running
Commit
·
d297f1b
1
Parent(s):
31589d9
Update index.html
Browse files- index.html +5 -8
index.html
CHANGED
@@ -30,7 +30,7 @@
|
|
30 |
<div id="error"></div>
|
31 |
|
32 |
<script type="module">
|
33 |
-
import { createRepo,
|
34 |
|
35 |
const uploadButton = document.getElementById('uploadButton');
|
36 |
uploadButton.addEventListener('click', uploadFiles);
|
@@ -71,14 +71,11 @@
|
|
71 |
const file = files[i];
|
72 |
try {
|
73 |
// upload file
|
74 |
-
await
|
75 |
repo: REPO_ID,
|
76 |
credentials: { accessToken: HF_ACCESS_TOKEN },
|
77 |
-
|
78 |
-
|
79 |
-
path: file.name,
|
80 |
-
content: file, // use the file Blob directly
|
81 |
-
}],
|
82 |
});
|
83 |
|
84 |
console.log(`File ${file.name} uploaded successfully`);
|
@@ -99,4 +96,4 @@
|
|
99 |
}
|
100 |
</script>
|
101 |
</body>
|
102 |
-
</html>
|
|
|
30 |
<div id="error"></div>
|
31 |
|
32 |
<script type="module">
|
33 |
+
import { createRepo, uploadFile } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm";
|
34 |
|
35 |
const uploadButton = document.getElementById('uploadButton');
|
36 |
uploadButton.addEventListener('click', uploadFiles);
|
|
|
71 |
const file = files[i];
|
72 |
try {
|
73 |
// upload file
|
74 |
+
await uploadFile({
|
75 |
repo: REPO_ID,
|
76 |
credentials: { accessToken: HF_ACCESS_TOKEN },
|
77 |
+
file: file,
|
78 |
+
commitTitle: `committing file: ${file.name}`,
|
|
|
|
|
|
|
79 |
});
|
80 |
|
81 |
console.log(`File ${file.name} uploaded successfully`);
|
|
|
96 |
}
|
97 |
</script>
|
98 |
</body>
|
99 |
+
</html>
|