@genai-fi/nanogpt 0.5.3 → 0.5.4

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.
@@ -7,12 +7,18 @@ import { default as Trainer, ITrainerOptions } from './Trainer';
7
7
  import { default as MemoryProfiler } from './utilities/profile';
8
8
  import { TrainingProgress } from './training/Trainer';
9
9
  type TeachableLLMStatus = 'warmup' | 'awaitingTokens' | 'ready' | 'training' | 'loading' | 'busy' | 'error';
10
+ interface TeachableLLMMeta {
11
+ name?: string;
12
+ id?: string;
13
+ [key: string]: unknown;
14
+ }
10
15
  export default class TeachableLLM {
11
16
  private ee;
12
17
  private _config?;
13
18
  private _model?;
14
19
  private _tokeniser?;
15
20
  private _status;
21
+ meta: TeachableLLMMeta;
16
22
  constructor(tokeniser?: ITokeniser, model?: NanoGPT);
17
23
  get vocab(): string[];
18
24
  get loaded(): boolean;
@@ -47,6 +47,7 @@ class a {
47
47
  _model;
48
48
  _tokeniser;
49
49
  _status = "loading";
50
+ meta = {};
50
51
  constructor(t, e) {
51
52
  this._config = e?.config, this._tokeniser = t, this._model = e;
52
53
  }
@@ -83,7 +84,10 @@ class a {
83
84
  saveModel(t) {
84
85
  if (!this._model || !this._tokeniser)
85
86
  throw new Error("Model or tokeniser is not initialized.");
86
- return d(this._model, this._tokeniser, t);
87
+ return d(this._model, this._tokeniser, {
88
+ ...t,
89
+ name: t?.name || this.meta.name
90
+ });
87
91
  }
88
92
  static loadModel(t) {
89
93
  const e = new a();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genai-fi/nanogpt",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",