Spaces:
Running
Running
Philipp S commited on
Commit ·
8f3c5f6
1
Parent(s): 2dd8e33
Add quantization option to model initialization for WebGPU and WASM
Browse files
script.js
CHANGED
|
@@ -25,6 +25,7 @@ async function init() {
|
|
| 25 |
depth_estimator = await pipeline('depth-estimation', MODEL_ID, {
|
| 26 |
device: 'webgpu',
|
| 27 |
dtype: 'fp32', // Important: Model is FP32
|
|
|
|
| 28 |
});
|
| 29 |
|
| 30 |
statusElement.textContent = 'Model loaded. Ready.';
|
|
@@ -37,7 +38,8 @@ async function init() {
|
|
| 37 |
statusElement.textContent = 'WebGPU failed, trying WASM...';
|
| 38 |
depth_estimator = await pipeline('depth-estimation', MODEL_ID, {
|
| 39 |
device: 'wasm',
|
| 40 |
-
dtype: 'fp32'
|
|
|
|
| 41 |
});
|
| 42 |
statusElement.textContent = 'Model loaded (WASM). Ready.';
|
| 43 |
runBtn.disabled = false;
|
|
|
|
| 25 |
depth_estimator = await pipeline('depth-estimation', MODEL_ID, {
|
| 26 |
device: 'webgpu',
|
| 27 |
dtype: 'fp32', // Important: Model is FP32
|
| 28 |
+
quantized: false
|
| 29 |
});
|
| 30 |
|
| 31 |
statusElement.textContent = 'Model loaded. Ready.';
|
|
|
|
| 38 |
statusElement.textContent = 'WebGPU failed, trying WASM...';
|
| 39 |
depth_estimator = await pipeline('depth-estimation', MODEL_ID, {
|
| 40 |
device: 'wasm',
|
| 41 |
+
dtype: 'fp32',
|
| 42 |
+
quantized: false
|
| 43 |
});
|
| 44 |
statusElement.textContent = 'Model loaded (WASM). Ready.';
|
| 45 |
runBtn.disabled = false;
|