浏览代码

增加项目可选启动项说明

glide-the 2 年之前
父节点
当前提交
f064699ee8
共有 2 个文件被更改,包括 77 次插入0 次删除
  1. 1 0
      README.md
  2. 76 0
      docs/StartOption.md

+ 1 - 0
README.md

@@ -141,6 +141,7 @@ $ python webui.py
 ```
 ```
 
 
 注:如未将模型下载至本地,请执行前检查`$HOME/.cache/huggingface/`文件夹剩余空间,至少15G。
 注:如未将模型下载至本地,请执行前检查`$HOME/.cache/huggingface/`文件夹剩余空间,至少15G。
+注:一些其它的可选启动项见[项目启动选项](docs/StartOption.md)
 
 
 执行后效果如下图所示:
 执行后效果如下图所示:
 ![webui](img/webui_0419.png)
 ![webui](img/webui_0419.png)

+ 76 - 0
docs/StartOption.md

@@ -0,0 +1,76 @@
+
+#### 项目启动选项
+```aidl
+usage: langchina-ChatGLM [-h] [--no-remote-model] [--model MODEL] [--lora LORA] [--model-dir MODEL_DIR] [--lora-dir LORA_DIR] [--cpu] [--auto-devices] [--gpu-memory GPU_MEMORY [GPU_MEMORY ...]] [--cpu-memory CPU_MEMORY]
+                         [--load-in-8bit] [--bf16]
+
+基于langchain和chatGML的LLM文档阅读器
+
+options:
+  -h, --help            show this help message and exit
+  --no-remote-model     remote in the model on loader checkpoint, if your load local model to add the ` --no-remote-model`
+  --model MODEL         Name of the model to load by default.
+  --lora LORA           Name of the LoRA to apply to the model by default.
+  --model-dir MODEL_DIR
+                        Path to directory with all the models
+  --lora-dir LORA_DIR   Path to directory with all the loras
+  --cpu                 Use the CPU to generate text. Warning: Training on CPU is extremely slow.
+  --auto-devices        Automatically split the model across the available GPU(s) and CPU.
+  --gpu-memory GPU_MEMORY [GPU_MEMORY ...]
+                        Maxmimum GPU memory in GiB to be allocated per GPU. Example: --gpu-memory 10 for a single GPU, --gpu-memory 10 5 for two GPUs. You can also set values in MiB like --gpu-memory 3500MiB.
+  --cpu-memory CPU_MEMORY
+                        Maximum CPU memory in GiB to allocate for offloaded weights. Same as above.
+  --load-in-8bit        Load the model with 8-bit precision.
+  --bf16                Load the model with bfloat16 precision. Requires NVIDIA Ampere GPU.
+
+```
+
+#### 示例
+
+- 1、加载本地模型
+
+```text
+--model-dir 本地checkpoint存放文件夹
+--model  模型名称
+--no-remote-model 不从远程加载模型
+```
+```shell
+$  python cli_demo.py --model-dir /media/mnt/ --model chatglm-6b --no-remote-model
+```
+
+- 2、低精度加载模型
+```text
+--model-dir 本地checkpoint存放文件夹
+--model  模型名称
+--no-remote-model 不从远程加载模型
+--load-in-8bit   以8位精度加载模型
+```
+```shell
+$ python cli_demo.py --model-dir /media/mnt/ --model chatglm-6b --no-remote-model --load-in-8bit   
+```
+
+
+- 3、使用cpu预测模型
+```text
+--model-dir 本地checkpoint存放文件夹
+--model  模型名称
+--no-remote-model 不从远程加载模型
+--cpu   使用CPU生成文本。警告:CPU上的训练非常缓慢。
+```
+```shell
+$ python cli_demo.py --model-dir /media/mnt/ --model chatglm-6b --no-remote-model --cpu 
+```
+
+
+
+- 3、加载lora微调文件
+```text
+--model-dir 本地checkpoint存放文件夹
+--model  模型名称
+--no-remote-model 不从远程加载模型
+--lora-dir   本地lora存放文件夹
+--lora lora名称
+```
+```shell
+$ python cli_demo.py --model-dir /media/mnt/ --model chatglm-6b --no-remote-model --lora-dir  /media/mnt/loras --lora chatglm-step100
+```