Skip to content

Commit 13c6d04

Browse files
Merge pull request #421 from JingyuanZhang/master
fix(core): support backend init async promise in webgpu
2 parents 1c21440 + 124c3d2 commit 13c6d04

File tree

9 files changed

+21
-10
lines changed

9 files changed

+21
-10
lines changed

e2e/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ module.exports = {
108108

109109
// Whether to use watchman for file crawling
110110
// watchman: true,
111-
testTimeout: 50000
111+
testTimeout: 80000
112112
};

e2e/tests/detect.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('e2e test detect model', () => {
55
const CUR_URL = 'http://localhost:9898/';
66

77
beforeAll(async () => {
8-
await page.goto(CUR_URL);
8+
await page.goto(CUR_URL, {
9+
timeout: 0
10+
});
911
});
1012

1113
it('detect predict', async () => {

e2e/tests/gesture.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ describe('e2e test gesture model', () => {
33
const CUR_URL = 'http://localhost:9898/';
44

55
beforeAll(async () => {
6-
await page.goto(CUR_URL);
6+
await page.goto(CUR_URL, {
7+
timeout: 0
8+
});
79
});
810

911
it('gesture predict', async () => {

e2e/tests/humanseg.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ describe('e2e test humanseg model', () => {
33
const CUR_URL = 'http://localhost:9898/';
44

55
beforeAll(async () => {
6-
await page.goto(CUR_URL);
6+
await page.goto(CUR_URL, {
7+
timeout: 0
8+
});
79
});
810

911
it('humanseg predict', async () => {

e2e/tests/mobilenet.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('e2e test mobilenet model', () => {
55
const CUR_URL = 'http://localhost:9898/';
66

77
beforeAll(async () => {
8-
await page.goto(CUR_URL);
8+
await page.goto(CUR_URL, {
9+
timeout: 0
10+
});
911
});
1012

1113
it('check predict data', async () => {

e2e/tests/ocr.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ describe('e2e test ocr model', () => {
55
const CUR_URL = 'http://localhost:9898/';
66

77
beforeAll(async () => {
8-
await page.goto(CUR_URL);
8+
await page.goto(CUR_URL, {
9+
timeout: 0
10+
});
911
});
1012

1113
it('ocr predict', async () => {

e2e/tests/predict.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ describe('e2e test custom model', () => {
44
const CUR_URL = 'http://localhost:9898/';
55

66
beforeAll(async () => {
7-
await page.goto(CUR_URL);
7+
await page.goto(CUR_URL, {
8+
timeout: 0
9+
});
810
});
911

1012
it('check predict data', async () => {

packages/paddlejs-core/src/opFactory/opBehaviors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ const behaviors : Behaviors = {
248248
processElementwiseAxis() {
249249
const shape_x = this.tensorDataMap['origin'].shape;
250250
const shape_y = this.tensorDataMap['counter'].shape;
251-
let axis = this.processedAttrs.axis || -1;
251+
let axis = this.processedAttrs.axis === undefined ? -1 : this.processedAttrs.axis;
252252

253253
this.processedAttrs.counterLen = shape_y.length;
254254
// shape x === shape y

packages/paddlejs-core/src/runner.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ export default class Runner {
5858
await Promise.all([this.load(), GLOBALS.backendInstance.init()]);
5959
}
6060
else {
61-
GLOBALS.backendInstance.init();
62-
this.isExecuted = false;
61+
await GLOBALS.backendInstance.init();
6362
await this.load();
6463
}
6564
this.genFeedData();

0 commit comments

Comments
 (0)