@genai-fi/nanogpt 1.2.4 → 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,7 +64,7 @@ export default class Training {
64
64
  getJob(id: string): ITrainingJob | null;
65
65
  /** Resume a paused job and optionally change some options. */
66
66
  resume(id: string): Promise<void>;
67
- cancel(id: string): void;
67
+ cancel(id?: string): void;
68
68
  addBreak(jobid: string): number | undefined;
69
69
  deleteBreak(jobid: string, breakId: number): void;
70
70
  getPretrainingJob(): ITrainingJob | null;
@@ -180,12 +180,15 @@ var o = class {
180
180
  t && t.state === "paused" && (t.resumeCounter++, !(t.resumeCounter < t.breakOnLog.size) && (t.resumeCounter = 0, this.setState(t, "pending"), this.launchJob(t)));
181
181
  }
182
182
  cancel(e) {
183
- this.assertValidJobId(e);
184
- let t = this.getJob(e);
185
- if (t) if (t.state === "paused") {
186
- this.setState(t, "cancelled");
187
- return;
188
- } else (t.state === "running" || t.state === "pausing") && (this.setState(t, "cancelling"), t.trainer.stop());
183
+ if (e) {
184
+ this.assertValidJobId(e);
185
+ let t = this.getJob(e);
186
+ if (!t) return;
187
+ if (t.state === "paused") {
188
+ this.setState(t, "cancelled");
189
+ return;
190
+ } else (t.state === "running" || t.state === "pausing") && (this.setState(t, "cancelling"), t.trainer.stop());
191
+ } else for (let e of this._jobs.values()) e.state === "paused" ? this.setState(e, "cancelled") : (e.state === "running" || e.state === "pausing") && (this.setState(e, "cancelling"), e.trainer.stop());
189
192
  }
190
193
  addBreak(e) {
191
194
  let t = this.getJob(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/nanogpt",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",