This repository was archived by the owner on Apr 10, 2026. It is now read-only.
fix bug in tokenize_dataset_rows.py and infer.ipynb - #125
Open
zwkkk wants to merge 1 commit into
Open
Conversation
Owner
|
感谢PR~ 晚点我会测试下,没问题的话会merge |
mymusise
reviewed
Apr 7, 2023
| return_attention_mask=False, | ||
| add_special_tokens=False) | ||
| input_ids = prompt_ids + target_ids + [config.eos_token_id] | ||
| input_ids = prompt_ids + [150001, 150004] + target_ids + [150005] |
Owner
There was a problem hiding this comment.
这块修改和感觉是不是等价的?
prompt_ids = tokenizer.encode(**, add_special_tokens=True) == prompt_ids = tokenizer.encode(**, add_special_tokens=False) + [150001, 150004]
Owner
There was a problem hiding this comment.
如果用魔法数字会不会不太好,我看官方又更新了下token_id 🤣
Owner
There was a problem hiding this comment.
看了下官方的预处理代码,好像用它提供的build_inputs_with_special_tokens更好
prompt_ids = tokenizer.encode(, add_special_tokens=False)
target_ids = tokenizer.encode(, add_special_tokens=False)
tokenizer.build_inputs_with_special_tokens(prompt_ids, target_ids )
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在最近更新的版本中,
1 tokenize_dataset_rows.py存在[150004] not in list的bug。
2 infer.ipynb中存在mask bug。