OpenMOSS / OpenMOSS/AnyGPT

targets were set to all -100 in stage2_sft stage due to cur_len != expected_len

Open
#39 2 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.