Enable NUMA feature for llama_cpp_python (#4040)

This commit is contained in:
StoyanStAtanasov 2023-09-27 03:05:00 +02:00 committed by GitHub
parent 87ea2d96fd
commit 7e6ff8d1f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 12 deletions

View file

@ -172,6 +172,7 @@ class LlamacppHF(PreTrainedModel):
@classmethod
def from_pretrained(cls, pretrained_model_name_or_path: Optional[Union[str, os.PathLike]], *model_args, **kwargs):
assert len(model_args) == 0 and len(kwargs) == 0, "extra args is currently not supported"
if isinstance(pretrained_model_name_or_path, str):
pretrained_model_name_or_path = Path(pretrained_model_name_or_path)
@ -198,6 +199,7 @@ class LlamacppHF(PreTrainedModel):
'use_mlock': shared.args.mlock,
'mul_mat_q': shared.args.mul_mat_q,
'low_vram': shared.args.low_vram,
'numa': shared.args.numa,
'n_gpu_layers': shared.args.n_gpu_layers,
'rope_freq_base': RoPE.get_rope_freq_base(shared.args.alpha_value, shared.args.rope_freq_base),
'tensor_split': tensor_split_list,