targets were set to all -100 in stage2_sft stage due to cur_len != expected_len
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 882
- Forks
- 76
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
In stage2_sft.py (line 292), the targets are all set to -100 because cur_len isn't updated to match expected_len. This seems like a bug. Could you please help to verify this? Thanks!
if cur_len < tokenizer.model_max_length:
if cur_len != expected_len:
for k in range(total_len):
target[k] = IGNORE_TOKEN_ID
rank0_print(
f"WARNING: tokenization mismatch: {cur_len} vs. {total_len}."
f" #turn = {len(turns) - 1}. (ignored)"
)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at stage2_sft.py line 292 and trace how cur_len and expected_len are computed before the shown target-masking branch. Verify why they diverge and whether the mismatch causes every target to become -100; done means confirming or correcting that behavior without discarding valid targets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100