Skip to content

Commit

Permalink
use locally built libs
Browse files Browse the repository at this point in the history
  • Loading branch information
albho committed Aug 21, 2024
1 parent 78b9bb9 commit a42c650
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions binding/web/src/orca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,8 @@ export class Orca {

private static async initWasm(accessKey: string, modelPath: string, wasmBase64: string): Promise<OrcaWasmOutput> {
// A WebAssembly page has a constant size of 64KiB. -> 1MiB ~= 16 pages
const memory = new WebAssembly.Memory({ initial: 7500 });
let memoryBufferUint8 = new Uint8Array(memory.buffer);
const memory = new WebAssembly.Memory({ initial: 1600, maximum: 6000 });
const memoryBufferUint8 = new Uint8Array(memory.buffer);
const pvError = new PvError();
const exports = await buildWasm(memory, wasmBase64, pvError);

Expand Down Expand Up @@ -1020,16 +1020,15 @@ export class Orca {
throw new OrcaErrors.OrcaOutOfMemoryError('malloc failed: Cannot allocate memory');
}

const memoryBufferView = new DataView(memory.buffer);

const initStatus = await pv_orca_init(
accessKeyAddress,
modelPathAddress,
objectAddressAddress);
await pv_free(accessKeyAddress);
await pv_free(modelPathAddress);

const memoryBufferView = new DataView(memory.buffer);
memoryBufferUint8 = new Uint8Array(memory.buffer);

if (initStatus !== PvStatus.SUCCESS) {
const messageStack = await Orca.getMessageStack(
pv_get_error_stack,
Expand Down
2 changes: 1 addition & 1 deletion binding/web/src/orca_worker_handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ self.onmessage = async function(
self.postMessage({
command: 'error',
status: PvStatus.RUNTIME_ERROR,
shortMessage: 'Orca synthesize error',
shortMessage: e.message,
});
}
}
Expand Down
Binary file modified lib/wasm/pv_orca.wasm
100755 → 100644
Binary file not shown.
Binary file modified lib/wasm/pv_orca_simd.wasm
100755 → 100644
Binary file not shown.

0 comments on commit a42c650

Please sign in to comment.