@@ -18,6 +18,7 @@ type ChatCommand = {
18
18
wrapper : "auto" | "general" | "llamaChat" | "chatML" ,
19
19
contextSize : number ,
20
20
grammar : "text" | Parameters < typeof LlamaGrammar . getFor > [ 0 ] ,
21
+ threads : number ,
21
22
temperature : number ,
22
23
topK : number ,
23
24
topP : number ,
@@ -76,6 +77,12 @@ export const ChatCommand: CommandModule<object, ChatCommand> = {
76
77
description : "Restrict the model response to a specific grammar, like JSON for example" ,
77
78
group : "Optional:"
78
79
} )
80
+ . option ( "threads" , {
81
+ type : "number" ,
82
+ default : 6 ,
83
+ description : "Number of threads to use for the evaluation of tokens" ,
84
+ group : "Optional:"
85
+ } )
79
86
. option ( "temperature" , {
80
87
alias : "t" ,
81
88
type : "number" ,
@@ -107,10 +114,10 @@ export const ChatCommand: CommandModule<object, ChatCommand> = {
107
114
} ,
108
115
async handler ( {
109
116
model, systemInfo, systemPrompt, wrapper, contextSize, grammar,
110
- temperature, topK, topP, maxTokens
117
+ threads , temperature, topK, topP, maxTokens
111
118
} ) {
112
119
try {
113
- await RunChat ( { model, systemInfo, systemPrompt, wrapper, contextSize, grammar, temperature, topK, topP, maxTokens} ) ;
120
+ await RunChat ( { model, systemInfo, systemPrompt, wrapper, contextSize, grammar, threads , temperature, topK, topP, maxTokens} ) ;
114
121
} catch ( err ) {
115
122
console . error ( err ) ;
116
123
process . exit ( 1 ) ;
@@ -120,7 +127,7 @@ export const ChatCommand: CommandModule<object, ChatCommand> = {
120
127
121
128
122
129
async function RunChat ( {
123
- model : modelArg , systemInfo, systemPrompt, wrapper, contextSize, grammar : grammarArg , temperature, topK, topP, maxTokens
130
+ model : modelArg , systemInfo, systemPrompt, wrapper, contextSize, grammar : grammarArg , threads , temperature, topK, topP, maxTokens
124
131
} : ChatCommand ) {
125
132
const { LlamaChatSession} = await import ( "../../llamaEvaluator/LlamaChatSession.js" ) ;
126
133
const { LlamaModel} = await import ( "../../llamaEvaluator/LlamaModel.js" ) ;
@@ -130,6 +137,7 @@ async function RunChat({
130
137
const model = new LlamaModel ( {
131
138
modelPath : modelArg ,
132
139
contextSize,
140
+ threads,
133
141
temperature,
134
142
topK,
135
143
topP
0 commit comments