multimodalart HF Staff commited on
Commit
d297f1b
·
1 Parent(s): 31589d9

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +5 -8
index.html CHANGED
@@ -30,7 +30,7 @@
30
  <div id="error"></div>
31
 
32
  <script type="module">
33
- import { createRepo, commit } from "https://cdn.jsdelivr.net/npm/@huggingface/[email protected]/+esm";
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 commit({
75
  repo: REPO_ID,
76
  credentials: { accessToken: HF_ACCESS_TOKEN },
77
- message: `committing file: ${file.name}`,
78
- files: [{
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>