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

alibaba / pipcook / 4088643824

pending completion
4088643824

Pull #951

github

GitHub
Merge 3588a38ba into c1acf7dc8
Pull Request #951: build(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /packages/cli

436 of 530 branches covered (82.26%)

Branch coverage included in aggregate %.

692 of 736 relevant lines covered (94.02%)

4.81 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