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

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +2 -11
index.html CHANGED
@@ -69,15 +69,6 @@
69
 
70
  for (let i = 0; i < files.length; i++) {
71
  const file = files[i];
72
- const arrayBuffer = await new Promise((resolve, reject) => {
73
- const reader = new FileReader();
74
- reader.readAsArrayBuffer(file);
75
- reader.onload = () => resolve(reader.result);
76
- reader.onerror = reject;
77
- });
78
-
79
- const uint8Array = new Uint8Array(arrayBuffer);
80
-
81
  try {
82
  // upload file
83
  await commit({
@@ -86,7 +77,7 @@
86
  message: `committing file: ${file.name}`,
87
  files: [{
88
  path: file.name,
89
- content: uint8Array,
90
  }],
91
  });
92
 
@@ -108,4 +99,4 @@
108
  }
109
  </script>
110
  </body>
111
- </html>
 
69
 
70
  for (let i = 0; i < files.length; i++) {
71
  const file = files[i];
 
 
 
 
 
 
 
 
 
72
  try {
73
  // upload file
74
  await commit({
 
77
  message: `committing file: ${file.name}`,
78
  files: [{
79
  path: file.name,
80
+ content: file, // use the file Blob directly
81
  }],
82
  });
83
 
 
99
  }
100
  </script>
101
  </body>
102
+ </html>