• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alibaba / pipcook / 3672821434

pending completion
3672821434

Pull #945

github

GitHub
Merge bceee5a4e into c1acf7dc8
Pull Request #945: build(deps): bump qs from 6.5.2 to 6.5.3

436 of 530 branches covered (82.26%)

Branch coverage included in aggregate %.

692 of 736 relevant lines covered (94.02%)

4.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

86.36
/packages/cli/src/standalone-impl.ts
1
import { ProgressInfo } from '@pipcook/core';
2
import { pipelineAsync } from './utils';
3✔
3
import { DefaultDataSet, DefaultRuntime } from '@pipcook/costa';
4
import * as fs from 'fs-extra';
3✔
5
import * as path from 'path';
3✔
6

7
export class StandaloneImpl implements DefaultRuntime {
3✔
8
  constructor(
9
    public dataset: DefaultDataSet,
3✔
10
    private modelDir: string
3✔
11
  ) {}
12

13
  async notifyProgress(progress: ProgressInfo): Promise<void> {
14
    console.log(`progress: ${progress.value}%`);
1✔
15
  }
16

17
  async saveModel(localPathOrStream: string | NodeJS.ReadableStream, filename: 'model'): Promise<void> {
18
    if (typeof localPathOrStream === 'string') {
2!
19
      if (path.parse(localPathOrStream).dir === this.modelDir || this.modelDir === path.resolve(localPathOrStream)) {
2✔
20
        return;
1✔
21
      }
22
      return fs.copy(localPathOrStream, this.modelDir);
1✔
23
    } else {
24
      const modelStream = fs.createWriteStream(path.join(this.modelDir, filename));
×
25
      return pipelineAsync(localPathOrStream, modelStream);
×
26
    }
27
  }
28

29
  async readModel(): Promise<string> {
30
    return this.modelDir;
1✔
31
  }
32
}
33

34
export const createStandaloneRT = (
3✔
35
  datasource: DefaultDataSet,
36
  modelDir: string
37
): DefaultRuntime => {
38
  return new StandaloneImpl(datasource, modelDir);
3✔
39
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc