Skip to content

Conversation

@HAOCHENYE
Copy link
Collaborator

@HAOCHENYE HAOCHENYE commented Dec 29, 2025

Modifications

  1. mask the loss of <think></think>\n\n rather than bare <think></think>
  2. mask the loss of <think>

How to use

Enable

Enable the hardcode patch by:

export XTUNER_SKIP_EMPTY_THINK=1

The following log will be displayed in the console output (stdout/stderr), not in the log file:

"SkipEmptyThink is enabled to skip empty sequences in labels."

Visualize the tokenized data by:

python .dev_scripts/visualize/tokenize_fn_file.py <tokenizer-path> <jsonl-path>
image

Only the red part will calculate the loss.

@HAOCHENYE HAOCHENYE force-pushed the yehc/hardcode-fucking-plus branch 2 times, most recently from fff38f5 to 0a0c1e7 Compare December 29, 2025 11:49
1. mask the loss of `<think></think>\n\n` rather than bare `<think></think>`
2. mask the loss of `<think>`
3. User can visualize the tokenized data by (Just for `Qwen3VLTokenizeFunction`)

```console
python .dev_scripts/visualize/tokenize_fn_file.py <tokenizer-path> <jsonl-path>
```
@HAOCHENYE HAOCHENYE force-pushed the yehc/hardcode-fucking-plus branch from 0a0c1e7 to 56e4fc0 Compare December 29, 2025 12:02
@HAOCHENYE HAOCHENYE merged commit 861e44a into InternLM:main Dec 29, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants