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; ngl?: number;
embedding?: boolean; embedding?: boolean;
n_parallel?: number; n_parallel?: number;
cpu_threads: number;
system_prompt?: string; system_prompt?: string;
user_prompt?: string; user_prompt?: string;
ai_prompt?: string; ai_prompt?: string;

View File

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

View File

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

View File

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

View File

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