Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用sft微调Qwen-7b-Chat模型的时候,labels被截断 #1494

Closed
cgq0816 opened this issue Nov 14, 2023 · 9 comments
Closed

使用sft微调Qwen-7b-Chat模型的时候,labels被截断 #1494

cgq0816 opened this issue Nov 14, 2023 · 9 comments
Labels
solved This problem has been already solved

Comments

@cgq0816
Copy link

cgq0816 commented Nov 14, 2023

image
如上图,使用sft微调Qwen-7b-Chat模型的时候,labels被截断,不完整,请问我该如何配置参数呢
目前输出字符最大长度是762

@cgq0816
Copy link
Author

cgq0816 commented Nov 14, 2023

image 如上图,使用sft微调Qwen-7b-Chat模型的时候,labels被截断,不完整,请问我该如何配置参数呢 目前输出字符最大长度是762
设置了一些参数,还是会截断
--cutoff_len 32768 --max_length 1024 --max_new_tokens 1024

@hiyouga hiyouga reopened this Nov 14, 2023
@hiyouga
Copy link
Owner

hiyouga commented Nov 14, 2023

Try --cutoff_len 32768 --reserved_label_len 16384

@hiyouga hiyouga added the solved This problem has been already solved label Nov 14, 2023
@cgq0816
Copy link
Author

cgq0816 commented Nov 14, 2023

Try --cutoff_len 32768 --reserved_label_len 16384

image
transformers==4.34.1,找不到reserved_label_len这个参数,目前项目不支持transformers 4.35.0

@hiyouga
Copy link
Owner

hiyouga commented Nov 14, 2023

你需要更新仓库代码

@cgq0816
Copy link
Author

cgq0816 commented Nov 14, 2023

你需要更新仓库代码

image
更新了,也设置了,还是被截断

@hiyouga
Copy link
Owner

hiyouga commented Nov 14, 2023

看起来你的数据本身就长这样

@cgq0816
Copy link
Author

cgq0816 commented Nov 14, 2023

看起来你的数据本身就长这样

{
"conversations": [{
"from": "user",
"value": "Answer the following questions as best you can. You have access to the following tools:Final Answer: the final answer to the original input question\n\nBegin!\n\nQuestion: xxxxx(语料很长,省略)"
}, {
"from": "assistant",
"value": "Thought: 正在使用基金持股信息明细表查找“博敏电子的机构持仓分布情况如何?(基金、券商、保险、其他机构等对博敏电子的持仓情况)”\n Action: orgoperOrgOperHoldInfoDtlget_data_from_org_info\n Action Input: {\n "org_info": "博敏电子"\n}"
}]
}
这是我数据的格式,按照sharegpt的格式组装的数据
image
还是不全,是我做的语料有问题吗?这个是按照qwen官方的例子做的语料集
https://github.com/QwenLM/Qwen/blob/main/examples/function_call_finetune_examples.py

@hiyouga
Copy link
Owner

hiyouga commented Nov 14, 2023

我看图中是全的,哪里缺了吗?

@cgq0816
Copy link
Author

cgq0816 commented Nov 14, 2023

我看图中是全的,哪里缺了吗?
多谢,是我看错了

@cgq0816 cgq0816 closed this as completed Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

2 participants