Skip to content

Commit 23e2a32

Browse files
committed
fix: default ngl
1 parent 7cc408a commit 23e2a32

File tree

1 file changed

+3
-1
lines changed
  • extensions/llamacpp-extension/src

1 file changed

+3
-1
lines changed

extensions/llamacpp-extension/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,9 @@ export default class llamacpp_extension extends AIEngine {
11821182

11831183
// Add remaining options from the interface
11841184
if (cfg.chat_template) args.push('--chat-template', cfg.chat_template)
1185-
args.push('-ngl', String(cfg.n_gpu_layers >= 0 ? cfg.n_gpu_layers : 100))
1185+
const gpu_layers =
1186+
parseInt(String(cfg.n_gpu_layers)) >= 0 ? cfg.n_gpu_layers : 100
1187+
args.push('-ngl', String(gpu_layers))
11861188
if (cfg.threads > 0) args.push('--threads', String(cfg.threads))
11871189
if (cfg.threads_batch > 0)
11881190
args.push('--threads-batch', String(cfg.threads_batch))

0 commit comments

Comments
 (0)