From 93188f3ce144e96058141b1730f173cecda6063a Mon Sep 17 00:00:00 2001 From: cgli Date: Sun, 15 Oct 2023 17:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/fastllm_pytools.md | 15 +++++++++++++++ include/fastllm.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/fastllm_pytools.md b/docs/fastllm_pytools.md index e69de29b..eb0d1acf 100644 --- a/docs/fastllm_pytools.md +++ b/docs/fastllm_pytools.md @@ -0,0 +1,15 @@ +# fastllm-pytools API + +## 全局参数设置 + +| 方法 | 说明 | +| ----- | ----- | +| llm.print_ins_info() | 显示当前编译的指令集支持情况 | +| llm.set_cpu_threads(threads:int) | 设置当前运行线程数,默认为4 | +| llm.get_cpu_threads()->int | 获取当前运行线程数 | +| llm.set_cpu_low_mem(low_mem:bool) | 设置低内存模式下运行,默认为False | +| llm.get_cpu_low_mem()->bool | 判断低内存模式下运行,为True则embedding放在文件中。 | +| llm.set_cpu_kvcache(cpu_kvcache:bool) | 设置是否将KVCache放在内存中,默认为False | +| llm.get_cpu_kvcache()->bool | 判断是否将KVCache放在内存而非GPU显存中(当前只对ChatGLM生效) | +| llm.set_device_map(device_map:str) | 设置推理设备,'cpu' 为CPU推理 ’cuda:0‘ 为0号CUDA GPU,以此类推 | + diff --git a/include/fastllm.h b/include/fastllm.h index a1ea663f..67d818d5 100644 --- a/include/fastllm.h +++ b/include/fastllm.h @@ -1,4 +1,4 @@ -// +// // Created by huangyuyang on 5/11/23. //