tylermullen commited on
Commit
57ef4e3
·
verified ·
1 Parent(s): 9e809c6

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -20
index.js CHANGED
@@ -183,26 +183,8 @@ async function pipeStreamAndReportProgress(readableStream, writableStream) {
183
  * For non-Chromium browsers, the user must upload the model manually.
184
  */
185
  async function loadLlmNonChromium() {
186
- alert('Your browser does not support automatic model downloading. Please run demo on Chrome, or you can try downloading the model manually and then selecting it from the file chooser.');
187
- loaderMessage.textContent = "Non-Chrome browsers are not fully supported. You can try downloading the model yourself manually, and then selecting it from the file chooser.";
188
- const fileButton = document.getElementById('safari-upload-file-button');
189
- const fileChooser = document.getElementById('safari-upload-file-chooser');
190
- fileChooser.style = "visibility:hidden";
191
- fileButton.style = "";
192
- const fileChosenPromise = new Promise((resolve) => {
193
- fileChooser.onchange = async (e) => {
194
- if (e.target.files && e.target.files[0]) {
195
- const fileReader = e.target.files[0].stream().getReader();
196
- await initLlm(fileReader);
197
- if (!llmInference) {
198
- alert('Model failed to load. Check console logs for errors.');
199
- }
200
- resolve();
201
- }
202
- };
203
- });
204
- fileButton.onclick = () => { fileChooser.click(); };
205
- await fileChosenPromise;
206
  }
207
 
208
  /**
 
183
  * For non-Chromium browsers, the user must upload the model manually.
184
  */
185
  async function loadLlmNonChromium() {
186
+ alert('Non-Chromium browsers are not supported yet. Please run demo on Chrome for the best experience.');
187
+ loaderMessage.textContent = "Non-Chromium browsers are not supported yet. Please run on Chrome for best experience.";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  }
189
 
190
  /**