Spaces:
Running
Running
Update index.js
Browse files
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('
|
| 187 |
-
loaderMessage.textContent = "Non-
|
| 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 |
/**
|