THUDM / ChatGLM3

ChatGLM3 series: Open Bilingual Chat LLMs | 开源双语对话语言模型
Apache License 2.0
13.39k stars 1.55k forks source link

ptuning_v2 微调后使用inference_hf.py推理 出现Both `max_new_tokens` (=512) and `max_length`(=8192) seem to have been set. `max_new_tokens` will take precedence. Please refer to the documentation for more information. (https://huggingface.co/docs/transformers/main/en/main_classes/text_generation) #1215

Closed 52566rz closed 4 months ago

52566rz commented 5 months ago

System Info / 系統信息

按照要求来的

Who can help? / 谁可以帮助到您?

No response

Information / 问题信息

Reproduction / 复现过程

微调:python finetune_hf.py data/ ../chatglm3-6b configs/ptuning_v2.yaml 推理:python inference_hf.py output_pv2/checkpoint-5000 --prompt 凉宫村日所在的社团 推理出现信息:Both max_new_tokens (=512) and max_length(=8192) seem to have been set. max_new_tokens will take precedence. Please refer to the documentation for more information. (https://huggingface.co/docs/transformers/main/en/main_classes/text_generation)

Expected behavior / 期待表现

这对结果有影响吗?

52566rz commented 5 months ago

我还想问一下作者,微调配置文件中predict_with_generate(是否使用生成模式进行预测)的true或false会有什么不同,感谢作者能够解答我的问题。

zRzRzRzRzRzRzR commented 5 months ago

你是只鹅512后就替换掉了原始的8192

predict_with_generate这个参数设置为true之后输出才是label

52566rz commented 5 months ago

谢谢作者,但我还是有点不理解您说的这个lable,是指的微调数据集合的标签吗?我尝试了lora微调和ptuning_v2微调发现在我的微调数据集下相同步数情况下lora的效果远好于pv2的效果,我就看了配置文件发现两文件predict_with_generate这个参数的设置不同,我也不知道什么意思。我是个小白,希望作者能再帮我解释一下。谢谢作者,祝作者天天开心,paper多多。

zRzRzRzRzRzRzR commented 4 months ago

lora效果更好在实际的应用中是很正常的。 predict_with_generate才能让模型输出内容并跟label对比