Spaces:
Running
Running
Update index.js
Browse files
index.js
CHANGED
|
@@ -175,17 +175,17 @@ async function pipeStreamAndReportProgress(readableStream, writableStream) {
|
|
| 175 |
async function loadLlmSafari() {
|
| 176 |
alert('Safari browser does not support automatic model downloading. However, you can try downloading the model manually and then selecting it from the file chooser.');
|
| 177 |
loaderMessage.textContent = "Safari not supported. You can try downloading the model yourself manually, and then selecting it from the file chooser.";
|
| 178 |
-
const
|
|
|
|
| 179 |
fileChooser.style = "visibility:hidden";
|
| 180 |
-
|
| 181 |
fileChooser.onchange = (e) => {
|
| 182 |
if (e.target.files && e.target.files[0]) {
|
| 183 |
const fileReader = e.target.files[0].stream().getReader();
|
| 184 |
initLlm(fileReader);
|
| 185 |
}
|
| 186 |
};
|
| 187 |
-
|
| 188 |
-
fileChooser.click();
|
| 189 |
}
|
| 190 |
|
| 191 |
/**
|
|
|
|
| 175 |
async function loadLlmSafari() {
|
| 176 |
alert('Safari browser does not support automatic model downloading. However, you can try downloading the model manually and then selecting it from the file chooser.');
|
| 177 |
loaderMessage.textContent = "Safari not supported. You can try downloading the model yourself manually, and then selecting it from the file chooser.";
|
| 178 |
+
const fileButton = document.getElementById('safari-file-upload-button');
|
| 179 |
+
const fileChooser = document.getElementById('safari-file-upload-chooser');
|
| 180 |
fileChooser.style = "visibility:hidden";
|
| 181 |
+
fileButton.style = "";
|
| 182 |
fileChooser.onchange = (e) => {
|
| 183 |
if (e.target.files && e.target.files[0]) {
|
| 184 |
const fileReader = e.target.files[0].stream().getReader();
|
| 185 |
initLlm(fileReader);
|
| 186 |
}
|
| 187 |
};
|
| 188 |
+
fileButton.onclick = () => { fileChooser.click(); };
|
|
|
|
| 189 |
}
|
| 190 |
|
| 191 |
/**
|