Skip to content

Commit e211111

Browse files
committed
LanguageModel: Save prompt with instance
1 parent 3939aac commit e211111

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/LanguageModel/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class LanguageModel extends EventEmitter {
4848
throw 'You need to provide the name of the model to load, e.g. TinyStories-15M';
4949
}
5050

51+
this.prompt = '';
5152
this.text = '';
5253
this.tokens = [];
5354
this.words = [];
@@ -180,6 +181,7 @@ class LanguageModel extends EventEmitter {
180181

181182
await this.llama2.ccall('set_parameters', null, [ 'number', 'number' ], [ this.options.temperature, this.options.steps ]);
182183

184+
this.prompt = prompt;
183185
this.text = '';
184186
this.tokens = [{ index: 1, str: '<s>', probability: 1 }];
185187
this.words = [];
@@ -235,6 +237,7 @@ class LanguageModel extends EventEmitter {
235237

236238
await this.llama2.ccall('set_parameters', null, [ 'number', 'number' ], [ this.options.temperature, this.options.steps ]);
237239

240+
this.prompt = prompt;
238241
this.text = '';
239242
this.tokens = [];
240243
this.words = [];

0 commit comments

Comments
 (0)