@genai-fi/nanogpt 0.15.12 → 0.15.13
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/dist/Generator.d.ts +2 -2
- package/dist/Generator.js +1 -1
- package/package.json +1 -1
package/dist/Generator.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface IGenerateOptions extends GenerateOptions {
|
|
|
19
19
|
nonConversational?: boolean;
|
|
20
20
|
continuation?: boolean;
|
|
21
21
|
}
|
|
22
|
-
export interface IGenerator extends EE<'start' | 'stop' | 'tokens'> {
|
|
22
|
+
export interface IGenerator extends EE<'start' | 'stop' | 'tokens' | 'reset'> {
|
|
23
23
|
generate(prompt: Conversation[], options?: IGenerateOptions): Promise<Conversation[]>;
|
|
24
24
|
generate(options?: IGenerateOptions): Promise<Conversation[]>;
|
|
25
25
|
step(prompt: Conversation[], options?: IGenerateOptions): Promise<Conversation[]>;
|
|
@@ -42,7 +42,7 @@ export interface IGenerator extends EE<'start' | 'stop' | 'tokens'> {
|
|
|
42
42
|
* Text generator using a NanoGPT model and a tokeniser.
|
|
43
43
|
* This uses the forward method of the model to generate text token by token, including options for temperature, top-k, and top-p sampling.
|
|
44
44
|
*/
|
|
45
|
-
export default class Generator extends EE<'start' | 'stop' | 'tokens'> implements IGenerator {
|
|
45
|
+
export default class Generator extends EE<'start' | 'stop' | 'tokens' | 'reset'> implements IGenerator {
|
|
46
46
|
private readonly model;
|
|
47
47
|
private readonly tokeniser;
|
|
48
48
|
private active;
|
package/dist/Generator.js
CHANGED
|
@@ -11843,7 +11843,7 @@ class AS extends Ui {
|
|
|
11843
11843
|
}), t || (this.cache = null)), this.lastToken = -1;
|
|
11844
11844
|
}
|
|
11845
11845
|
reset() {
|
|
11846
|
-
this.resetCache(), this.outputConversation = [], this.initialPrompt = null, this.attentionData = [], this.probabilitiesData = [], this.tokens = [], this.lastLoss = null;
|
|
11846
|
+
this.resetCache(), this.outputConversation = [], this.initialPrompt = null, this.attentionData = [], this.probabilitiesData = [], this.tokens = [], this.lastLoss = null, this.emit("reset");
|
|
11847
11847
|
}
|
|
11848
11848
|
dispose() {
|
|
11849
11849
|
this.reset();
|