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

Packing的问题咨询 #3672

Closed
1 task done
447428054 opened this issue May 10, 2024 · 1 comment
Closed
1 task done

Packing的问题咨询 #3672

447428054 opened this issue May 10, 2024 · 1 comment
Labels
solved This problem has been already solved.

Comments

@447428054
Copy link

447428054 commented May 10, 2024

Reminder

  • I have read the README and searched the existing issues.

Reproduction

total_length = len(input_ids)
block_size = data_args.cutoff_len
# we drop the small remainder, and if the total_length < block_size, we exclude this batch
total_length = (total_length // block_size) * block_size
# split by chunks of cutoff_len
for i in range(0, total_length, block_size):
    if not all(label == IGNORE_INDEX for label in labels[i : i + block_size]):
        model_inputs["input_ids"].append(input_ids[i : i + block_size])
        model_inputs["attention_mask"].append([1] * block_size)
        model_inputs["labels"].append(labels[i : i + block_size])

return model_inputs

packing是将输入按照指定长度切分开,所以单轮数据的拼接是在数据集层面自己拼接吗?

Expected behavior

No response

System Info

No response

Others

No response

@codemayq
Copy link
Collaborator

不是很明白你的问题是什么,数据不管是单轮还是多轮都按照数据集的格式要求分字段存入即可。

@codemayq codemayq added the pending This problem is yet to be addressed. label May 11, 2024
@hiyouga hiyouga added solved This problem has been already solved. and removed pending This problem is yet to be addressed. labels May 11, 2024
@hiyouga hiyouga closed this as completed May 11, 2024
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

3 participants