chore: Update n_threads to cpu_threads

This commit is contained in:
hiro 2023-12-12 05:58:08 +07:00
parent 0e63689eae
commit 16c66e968c
5 changed files with 4 additions and 3 deletions

View File

@ -275,6 +275,7 @@ export type ModelSettingParams = {
ngl?: number;
embedding?: boolean;
n_parallel?: number;
cpu_threads: number;
system_prompt?: string;
user_prompt?: string;
ai_prompt?: string;

View File

@ -12,6 +12,7 @@ declare const INFERENCE_URL: string;
interface EngineSettings {
ctx_len: number;
ngl: number;
cpu_threads: number;
cont_batching: boolean;
embedding: boolean;
}

View File

@ -12,7 +12,6 @@ import {
EventName,
MessageRequest,
MessageStatus,
ModelSettingParams,
ExtensionType,
ThreadContent,
ThreadMessage,
@ -41,6 +40,7 @@ export default class JanInferenceNitroExtension implements InferenceExtension {
private static _engineSettings: EngineSettings = {
ctx_len: 2048,
ngl: 100,
cpu_threads: 1,
cont_batching: false,
embedding: false,
};

View File

@ -53,7 +53,7 @@ async function initModel(wrapper: any): Promise<ModelOperationResponse> {
llama_model_path: currentModelFile,
...wrapper.model.settings,
// This is critical and requires real system information
n_threads: nitroResourceProbe.numCpuPhysicalCore,
cpu_threads: nitroResourceProbe.numCpuPhysicalCore,
};
log.info(`Load model settings: ${JSON.stringify(settings, null, 2)}`);
return (

View File

@ -12,7 +12,6 @@ import {
EventName,
MessageRequest,
MessageStatus,
ModelSettingParams,
ExtensionType,
ThreadContent,
ThreadMessage,