Skip to content

Commit

Permalink
fix(core): support backend init async promise in webgpu
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyuanZhang committed Mar 29, 2022
1 parent 61716d9 commit 12fc5c9
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 10 deletions.
2 changes: 1 addition & 1 deletion e2e/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,5 @@ module.exports = {

// Whether to use watchman for file crawling
// watchman: true,
testTimeout: 50000
testTimeout: 80000
};
4 changes: 3 additions & 1 deletion e2e/tests/detect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ describe('e2e test detect model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('detect predict', async () => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/gesture.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ describe('e2e test gesture model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('gesture predict', async () => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/humanseg.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ describe('e2e test humanseg model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('humanseg predict', async () => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/mobilenet.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ describe('e2e test mobilenet model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('check predict data', async () => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/ocr.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ describe('e2e test ocr model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('ocr predict', async () => {
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/predict.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ describe('e2e test custom model', () => {
const CUR_URL = 'http://localhost:9898/';

beforeAll(async () => {
await page.goto(CUR_URL);
await page.goto(CUR_URL, {
timeout: 0
});
});

it('check predict data', async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/paddlejs-core/src/opFactory/opBehaviors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ const behaviors : Behaviors = {
processElementwiseAxis() {
const shape_x = this.tensorDataMap['origin'].shape;
const shape_y = this.tensorDataMap['counter'].shape;
let axis = this.processedAttrs.axis || -1;
let axis = this.processedAttrs.axis === undefined ? -1 : this.processedAttrs.axis;

this.processedAttrs.counterLen = shape_y.length;
// shape x === shape y
Expand Down
3 changes: 1 addition & 2 deletions packages/paddlejs-core/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ export default class Runner {
await Promise.all([this.load(), GLOBALS.backendInstance.init()]);
}
else {
GLOBALS.backendInstance.init();
this.isExecuted = false;
await GLOBALS.backendInstance.init();
await this.load();
}
this.genFeedData();
Expand Down

0 comments on commit 12fc5c9

Please sign in to comment.