keldenl/gpt-llama.cpp

Add "--mlock" for M1 mac, on routes/chatRoutes.js

m0chael opened this issue · 1 comments

Adding the --mlock flag to the ./main call seemed to increase the speed of a 7B model to be much faster on an M1 Mac.

Modifying routes/chatRoutes.js with scriptArgs looking a little like this with the option enabled.

const scriptArgs = [
    '-m',
    modelPath,
    ...args,
    ...stopArgs,
    '--mlock',
    '-i',
    '-p',
    initPrompt
];

Thank you.

Done.. and with even MORE ARGUMENTS in this commit 71e836c

Supported flags right now:

const supportedUserArgsToTypes = {
	threads: 'number',
	ctx_size: 'number',
	repeat_penalty: 'number',
	mlock: 'undefined',
	lora: 'string',
	'lora-base': 'string',
};

Git pull in the latest changes or npm upgrade to 0.2.1 to get these changes

i haven't tested lora yet but i've tested the other ones and they work, just set these values (without the --) when you're starting the server, like so:

npm start mlock

and for those with values

npm start threads 10

and a mix works

npm start threads 10 mlock lora ../path/to/lora

lmk if you run into any issues!