fix(blur) check model response status and catch errors
This commit is contained in:
parent
67930edae2
commit
f69a31d9c6
|
@ -34,6 +34,10 @@ export async function createBlurEffect() {
|
||||||
models['144']
|
models['144']
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!modelResponse.ok) {
|
||||||
|
throw new Error('Failed to download tflite model!');
|
||||||
|
}
|
||||||
|
|
||||||
const model = await modelResponse.arrayBuffer();
|
const model = await modelResponse.arrayBuffer();
|
||||||
|
|
||||||
tflite.HEAPU8.set(new Uint8Array(model), modelBufferOffset);
|
tflite.HEAPU8.set(new Uint8Array(model), modelBufferOffset);
|
||||||
|
|
Loading…
Reference in New Issue