Spaces:
Sleeping
Sleeping
Commit ·
4039d9d
1
Parent(s): d314abb
feat(webgpu): add actionable UI error message for enabling chrome webgpu flags
Browse files- webgpu_prototype.html +6 -1
webgpu_prototype.html
CHANGED
|
@@ -55,8 +55,13 @@
|
|
| 55 |
statusEl.textContent = '[Status] Model loaded successfully!';
|
| 56 |
btnEl.disabled = false;
|
| 57 |
} catch (err) {
|
| 58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
console.error(err);
|
|
|
|
| 60 |
return;
|
| 61 |
}
|
| 62 |
}
|
|
|
|
| 55 |
statusEl.textContent = '[Status] Model loaded successfully!';
|
| 56 |
btnEl.disabled = false;
|
| 57 |
} catch (err) {
|
| 58 |
+
if (err.message.includes('GPU adapter') || err.message.includes('webgpu')) {
|
| 59 |
+
statusEl.innerHTML = '<span style="color: red;">[Status] WebGPU disabled by browser. To fix this, open a new tab and go to <b>chrome://flags/#enable-unsafe-webgpu</b>, set it to "Enabled", and restart your browser.</span>';
|
| 60 |
+
} else {
|
| 61 |
+
statusEl.textContent = '[Status] Error loading model: ' + err.message;
|
| 62 |
+
}
|
| 63 |
console.error(err);
|
| 64 |
+
btnEl.disabled = false;
|
| 65 |
return;
|
| 66 |
}
|
| 67 |
}
|