Skip to content

Commit

Permalink
Update openvino.js
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Sep 25, 2024
1 parent 11f7c14 commit 97bcd98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/openvino.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ openvino.ModelFactory = class {
}
if (extension === 'bin') {
const stream = context.stream;
const length = stream.length;
const length = Math.min(0x10000, stream.length);
if (length >= 4) {
let buffer = stream.peek(Math.min(0x20000, length));
let buffer = stream.peek(length);
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.length);
const signature = view.getUint32(0, true);
for (let i = 0; i < buffer.length - 4; i++) {
Expand Down Expand Up @@ -123,7 +123,7 @@ openvino.ModelFactory = class {
context = await context.fetch(file, null);
} catch (error) {
const message = error && error.message ? error.message : error.toString();
throw new openvino.Error(`OpenVINO model definition required (${message.replace(/\.$/, '')}).`);
throw new openvino.Error(`Required OpenVINO model definition not found (${message.replace(/\.$/, '')}).`);
}
break;
}
Expand Down

0 comments on commit 97bcd98

Please sign in to comment.