@genai-fi/nanogpt 0.24.0 → 1.0.0
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.
- package/README.md +78 -281
- package/dist/{RealDiv-CNsvC4AU.js → RealDiv-CSnvtN2E.js} +20 -20
- package/dist/{Reshape-dnm9bO3B.js → Reshape-BlylqwWy.js} +12 -12
- package/dist/TeachableLLM.d.ts +10 -14
- package/dist/TeachableLLM.js +201 -2
- package/dist/api/responses.d.ts +81 -0
- package/dist/api/responses.js +169 -0
- package/dist/api/training.d.ts +70 -0
- package/dist/api/training.js +205 -0
- package/dist/data/docx.js +9 -3036
- package/dist/data/stream.d.ts +2 -2
- package/dist/data/textLoader.d.ts +1 -1
- package/dist/data/textLoader.js +1 -1
- package/dist/data.d.ts +3 -0
- package/dist/data.js +12 -0
- package/dist/{dist-BqAU9-yi.js → dist-CwK5S7Ls.js} +2168 -2168
- package/dist/{gpgpu_math-DBYEAAdI.js → gpgpu_math-20tPK8LM.js} +458 -458
- package/dist/{Generator.d.ts → inference/Generator.d.ts} +16 -44
- package/dist/inference/Generator.js +271 -0
- package/dist/inference/tokenisePrompt.d.ts +4 -0
- package/dist/inference/tokenisePrompt.js +13 -0
- package/dist/inference/types.d.ts +44 -8
- package/dist/inference/utilities.d.ts +9 -0
- package/dist/inference/utilities.js +20 -0
- package/dist/jszip.min-DKa1Rjyn.js +3033 -0
- package/dist/{kernel_funcs_utils-D-mATnGR.js → kernel_funcs_utils-ql8Y8qPn.js} +96 -93
- package/dist/layers/MLP.d.ts +1 -1
- package/dist/layers/PositionEmbedding.d.ts +2 -1
- package/dist/layers/PositionEmbedding.js +1 -1
- package/dist/layers/RMSNorm.d.ts +1 -1
- package/dist/layers/TiedEmbedding.js +1 -1
- package/dist/layers.d.ts +4 -0
- package/dist/layers.js +14 -0
- package/dist/loader/load.js +58 -2
- package/dist/loader/loadHF.d.ts +1 -1
- package/dist/loader/loadHF.js +17 -2
- package/dist/loader/loadTransformers.js +46 -2
- package/dist/loader/newZipLoad.js +25 -2
- package/dist/loader/oldZipLoad.d.ts +1 -1
- package/dist/loader/oldZipLoad.js +37 -2
- package/dist/loader/save.js +75 -2
- package/dist/loader/types.d.ts +3 -3
- package/dist/main.d.ts +34 -35
- package/dist/main.js +12327 -20
- package/dist/{matMulGelu-BAIgQaRx.js → matMulGelu-CBoqTZM7.js} +2 -2
- package/dist/models/NanoGPTV1.js +95 -2
- package/dist/models/NanoGPTV2.js +86 -2
- package/dist/models/factory.js +13 -2
- package/dist/models/model.js +76 -2
- package/dist/models.d.ts +4 -0
- package/dist/models.js +14 -0
- package/dist/ops/dot16.js +1 -1
- package/dist/ops/matMulGelu.js +1 -1
- package/dist/ops/webgl/adamAdjust.js +1 -1
- package/dist/ops/webgl/fusedSoftmax.js +2 -2
- package/dist/ops/webgl/gelu.js +2 -2
- package/dist/ops/webgl/log.js +5 -5
- package/dist/ops/webgl/matMulGelu.js +1 -1
- package/dist/ops/webgl/matMulMul.js +1 -1
- package/dist/{tfjs_backend-CydPRQTc.js → tfjs_backend-h5weiy1O.js} +36 -36
- package/dist/tokenise.d.ts +4 -0
- package/dist/tokenise.js +15 -0
- package/dist/training/BasicTrainer.d.ts +5 -10
- package/dist/training/BasicTrainer.js +80 -88
- package/dist/training/configure.d.ts +3 -0
- package/dist/training/configure.js +32 -0
- package/dist/training/factory.d.ts +6 -0
- package/dist/training/factory.js +8 -0
- package/dist/training/prepareData.d.ts +22 -0
- package/dist/training/prepareData.js +49 -0
- package/dist/training/tasks/tokenStream.d.ts +2 -1
- package/dist/training/types.d.ts +14 -1
- package/dist/training/validateOptions.d.ts +2 -0
- package/dist/training/validateOptions.js +19 -0
- package/dist/utilities/arrayShape.d.ts +1 -0
- package/dist/utilities/arrayShape.js +8 -0
- package/dist/utilities/waitForModel.d.ts +1 -1
- package/dist/v4-BK7K-jy_.js +30 -0
- package/package.json +8 -2
- package/dist/Generator.js +0 -2
- package/dist/Trainer-Cr7csbTD.js +0 -228
- package/dist/Trainer.d.ts +0 -45
- package/dist/Trainer.js +0 -2
- package/dist/main-Dz72vadm.js +0 -13267
package/dist/loader/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IGenerateOptions } from '../../inference/types';
|
|
2
2
|
import { LoRAConfig } from '../../models/config';
|
|
3
3
|
import { default as Model, ModelForwardAttributes, TrainingState } from '../../models/model';
|
|
4
4
|
import { ITokeniser } from '../../tokeniser/type';
|
|
@@ -42,7 +42,7 @@ export interface ActionLogEntry {
|
|
|
42
42
|
timestamp: number;
|
|
43
43
|
duration: number;
|
|
44
44
|
tokensProcessed: number;
|
|
45
|
-
options: TrainingOptions |
|
|
45
|
+
options: TrainingOptions | IGenerateOptions;
|
|
46
46
|
}
|
|
47
47
|
export interface TransformersMetadata {
|
|
48
48
|
name?: string;
|
|
@@ -55,7 +55,7 @@ export interface TransformersMetadata {
|
|
|
55
55
|
mode?: ModelMode;
|
|
56
56
|
pretrainingData?: DatasetMetadata[];
|
|
57
57
|
pretrainingSettings?: TrainingOptions;
|
|
58
|
-
generationSettings?:
|
|
58
|
+
generationSettings?: IGenerateOptions;
|
|
59
59
|
actionLog?: ActionLogEntry[];
|
|
60
60
|
[key: string]: unknown;
|
|
61
61
|
}
|
package/dist/main.d.ts
CHANGED
|
@@ -1,46 +1,45 @@
|
|
|
1
|
+
import { default as Evaluator } from './training/Evaluator';
|
|
2
|
+
import { AdamWOptimizer } from './training/AdamW';
|
|
3
|
+
import { estimateParameterCount, estimateMemoryUsage, estimateTrainingMemoryUsage, estimateResources, validateConfig } from './utilities/parameters';
|
|
4
|
+
import { default as topP } from './utilities/topP';
|
|
5
|
+
import { sliceUint16Shards, sliceUint8Shards } from './utilities/tokens';
|
|
6
|
+
import { default as performanceTest } from './utilities/performance';
|
|
7
|
+
import { sentenceEmbeddings, sentenceEmbeddingsTensor } from './utilities/sentences';
|
|
1
8
|
import { pack16 } from './ops/pack16';
|
|
2
9
|
import { unpack16 } from './ops/unpack16';
|
|
3
|
-
import { default as CausalSelfAttention } from './layers/CausalSelfAttention';
|
|
4
|
-
import { default as MLP } from './layers/MLP';
|
|
5
|
-
import { default as TransformerBlock } from './layers/TransformerBlock';
|
|
6
|
-
import { default as RoPECache } from './layers/RoPECache';
|
|
7
|
-
export { default as NanoGPT } from './models/NanoGPTV1';
|
|
8
10
|
export { default as TeachableLLM } from './TeachableLLM';
|
|
9
|
-
export
|
|
10
|
-
export {
|
|
11
|
-
export
|
|
12
|
-
export { default as generateDatasetID } from './utilities/datasetID';
|
|
13
|
-
export { default as loadTextData } from './data/textLoader';
|
|
11
|
+
export * as tokenise from './tokenise';
|
|
12
|
+
export type { ITokeniser, Conversation, Roles } from './tokeniser/type';
|
|
13
|
+
export * as data from './data';
|
|
14
14
|
export type { ConversationStream } from './data/stream';
|
|
15
|
-
export { MemoryConversationStream } from './data/stream';
|
|
16
15
|
export type { DatasetMetadata, ModelMode } from './loader/types';
|
|
17
|
-
export
|
|
18
|
-
export { default as Evaluator } from './training/Evaluator';
|
|
19
|
-
export { default as Trainer } from './Trainer';
|
|
20
|
-
export type { IGenerateOptions } from './Generator';
|
|
21
|
-
export { type ModelForwardAttributes, default as Model } from './models/model';
|
|
22
|
-
export type { ITokeniser, Conversation, Roles } from './tokeniser/type';
|
|
23
|
-
export type { TrainingOptions, TrainingLogEntry } from './training/types';
|
|
16
|
+
export * as models from './models';
|
|
24
17
|
export type { GPTConfig } from './models/config';
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
30
|
-
|
|
18
|
+
export type { ModelForwardAttributes } from './models/model';
|
|
19
|
+
export type { IGenerateOptions, IGeneratorResponse, IGeneratorOutput, GeneratorConversation } from './inference/types';
|
|
20
|
+
export type { TrainingOptions, TrainingLogEntry } from './training/types';
|
|
21
|
+
export type { ITrainingJob } from './api/training';
|
|
22
|
+
export declare const training: {
|
|
23
|
+
Evaluator: typeof Evaluator;
|
|
24
|
+
AdamWOptimizer: typeof AdamWOptimizer;
|
|
25
|
+
};
|
|
26
|
+
export declare const utilities: {
|
|
27
|
+
estimateParameterCount: typeof estimateParameterCount;
|
|
28
|
+
estimateMemoryUsage: typeof estimateMemoryUsage;
|
|
29
|
+
estimateTrainingMemoryUsage: typeof estimateTrainingMemoryUsage;
|
|
30
|
+
estimateResources: typeof estimateResources;
|
|
31
|
+
validateConfig: typeof validateConfig;
|
|
32
|
+
topP: typeof topP;
|
|
33
|
+
sliceUint16Shards: typeof sliceUint16Shards;
|
|
34
|
+
sliceUint8Shards: typeof sliceUint8Shards;
|
|
35
|
+
performanceTest: typeof performanceTest;
|
|
36
|
+
sentenceEmbeddings: typeof sentenceEmbeddings;
|
|
37
|
+
sentenceEmbeddingsTensor: typeof sentenceEmbeddingsTensor;
|
|
38
|
+
};
|
|
39
|
+
export declare const ops: {
|
|
31
40
|
pack16: typeof pack16;
|
|
32
41
|
unpack16: typeof unpack16;
|
|
33
42
|
};
|
|
34
|
-
export
|
|
35
|
-
export { selectBackend } from './backend';
|
|
36
|
-
export { default as performanceTest } from './utilities/performance';
|
|
37
|
-
export declare const layers: {
|
|
38
|
-
CausalSelfAttention: typeof CausalSelfAttention;
|
|
39
|
-
MLP: typeof MLP;
|
|
40
|
-
TransformerBlock: typeof TransformerBlock;
|
|
41
|
-
RoPECache: typeof RoPECache;
|
|
42
|
-
};
|
|
43
|
-
export { AdamWOptimizer } from './training/AdamW';
|
|
43
|
+
export * as layers from './layers';
|
|
44
44
|
export { default as checks } from './checks';
|
|
45
45
|
export type { TensorStatistics } from './checks/weights';
|
|
46
|
-
export { sentenceEmbeddings, sentenceEmbeddingsTensor } from './utilities/sentences';
|