File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/evaluator/LlamaChatSession
templates/electron-typescript-react Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -854,6 +854,7 @@ export class LlamaChatSession {
854
854
public async preloadPrompt ( prompt : string , options : LLamaChatPreloadPromptOptions = { } ) : Promise < void > {
855
855
await this . completePromptWithMeta ( prompt , {
856
856
...options ,
857
+ completeAsModel : false ,
857
858
maxTokens : 0
858
859
} ) ;
859
860
}
@@ -1009,7 +1010,9 @@ export class LlamaChatSession {
1009
1010
seed,
1010
1011
tokenBias,
1011
1012
customStopTriggers,
1012
- maxTokens,
1013
+ maxTokens : maxTokens == null
1014
+ ? undefined
1015
+ : Math . min ( 1 , maxTokens ) , // regular prompting ignores `maxTokens: 0`
1013
1016
temperature,
1014
1017
trimWhitespaceSuffix,
1015
1018
contextShift : {
Original file line number Diff line number Diff line change 13
13
"_postinstall" : " npm run models:pull" ,
14
14
"models:pull" : " node-llama-cpp pull --dir ./models \" {{modelUriOrUrl|escape|escape}}\" " ,
15
15
"start" : " vite dev" ,
16
- "start:inspect" : " ENABLE_INSPECT=true vite dev" ,
16
+ "start:inspect" : " cross-env ENABLE_INSPECT=true vite dev" ,
17
17
"start:build" : " electron ./dist-electron" ,
18
18
"prebuild" : " rimraf ./dist ./dist-electron ./release" ,
19
19
"build" : " tsc && vite build && electron-builder --config ./electron-builder.ts" ,
42
42
"@types/react-dom" : " ^19.1.3" ,
43
43
"@types/semver" : " ^7.7.0" ,
44
44
"@vitejs/plugin-react" : " ^4.4.1" ,
45
+ "cross-env" : " ^10.0.0" ,
45
46
"electron" : " ^36.2.0" ,
46
47
"electron-builder" : " ^26.0.12" ,
47
48
"eslint" : " ^9.26.0" ,
You can’t perform that action at this time.
0 commit comments