Baichuan-7B icon indicating copy to clipboard operation
Baichuan-7B copied to clipboard

推理参数如何设置才能复现最佳效果

Open weicheng59 opened this issue 1 year ago • 9 comments

imageimage 使用text-generation-webui,加载模型进行推理,chat 模式,parameters 为 LLaMA-Precise, 英文得不到应答,请问这是正确的推理方式吗? image

weicheng59 avatar Jun 15 '23 06:06 weicheng59

同问,对话或指令的模板怎么设置比较好啊

JaheimLee avatar Jun 15 '23 06:06 JaheimLee

从 README 看这个模型应该是一个 pretrain 模型,类似于 LLaMA。

如果用在对话上,可能还需要使用中文对话数据集以及指令数据集进行 SFT ,否则效果可能不会太好。

ninehills avatar Jun 15 '23 06:06 ninehills

感觉上是个basemodel 没有指令微调呢。

GITMrzk avatar Jun 15 '23 06:06 GITMrzk

是 base model,未SFT, 自己训练了SFT的对话数据,才有对话能力。

shibing624 avatar Jun 15 '23 10:06 shibing624

从 README 看这个模型应该是一个 pretrain 模型,类似于 LLaMA。

如果用在对话上,可能还需要使用中文对话数据集以及指令数据集进行 SFT ,否则效果可能不会太好。

是的

zmsn-2077 avatar Jun 15 '23 10:06 zmsn-2077

怎么加载到text-generation-webui中的呢,直接放到models里面,

python server.py --model baichuan-7B --chat --n-gpu-layers 200

启动会报错呢: (textgen) thomas@thomashooodeMacBook-Pro-2 text-generation-webui % python server.py --model baichuan-7B --chat --n-gpu-layers 200 bin /Users/thomas/miniconda3/envs/textgen/lib/python3.10/site-packages/bitsandbytes/libbitsandbytes_cpu.so /Users/thomas/miniconda3/envs/textgen/lib/python3.10/site-packages/bitsandbytes/cextension.py:34: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers, 8-bit multiplication, and GPU quantization are unavailable. warn("The installed version of bitsandbytes was compiled without GPU support. " 'NoneType' object has no attribute 'cadam32bit_grad_fp32' 2023-06-15 18:28:27 INFO:Loading baichuan-7B... Traceback (most recent call last): File "/Users/thomas/Documents/Pythons/ai/text-generation-webui/server.py", line 1154, in shared.model, shared.tokenizer = load_model(shared.model_name) File "/Users/thomas/Documents/Pythons/ai/text-generation-webui/modules/models.py", line 76, in load_model shared.model_type = find_model_type(model_name) File "/Users/thomas/Documents/Pythons/ai/text-generation-webui/modules/models.py", line 64, in find_model_type config = AutoConfig.from_pretrained(path_to_model, trust_remote_code=shared.args.trust_remote_code) File "/Users/thomas/miniconda3/envs/textgen/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 947, in from_pretrained trust_remote_code = resolve_trust_remote_code( File "/Users/thomas/miniconda3/envs/textgen/lib/python3.10/site-packages/transformers/dynamic_module_utils.py", line 553, in resolve_trust_remote_code raise ValueError( ValueError: Loading models/baichuan-7B requires you to execute the configuration file in that repo on your local machine. Make sure you have read the code there to avoid malicious use, then set the option trust_remote_code=True to remove this error.

thomashooo avatar Jun 15 '23 10:06 thomashooo

成功加载到text-generation-webui中,结果就是胡言乱语了。。

python server.py --model baichuan-7B --chat --n-gpu-layers 200 --trust_remote_code

thomashooo avatar Jun 16 '23 01:06 thomashooo

从 README 看这个模型应该是一个 pretrain 模型,类似于 LLaMA。

如果用在对话上,可能还需要使用中文对话数据集以及指令数据集进行 SFT ,否则效果可能不会太好。

你好,请教一下,如果我想用他做信息提取,从一段话里提取出一个包含指定字段的json,是不是需要先进行指令集训练?

Cola-Ice avatar Jun 16 '23 02:06 Cola-Ice

你好,请教一下,如果我想用他做信息提取,从一段话里提取出一个包含指定字段的json,是不是需要先进行指令集训练?

@Cola-Ice 是的,需要进行 Instruction Fine-Tuning,可以参考 https://github.com/baichuan-inc/baichuan-7B/issues/23

ninehills avatar Jun 16 '23 05:06 ninehills