-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Revised PoSE #8822
Revised PoSE #8822
Conversation
Thanks for your contribution! |
llm/run_finetune.py
Outdated
model_config.long_sequence_init_args = { | ||
"dim": int(model_config.hidden_size / model_config.num_attention_heads), | ||
"max_position_embeddings": data_args.scaled_max_length, # extended context window | ||
"base": 10000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
base建议从model config中读取
llm/run_finetune.py
Outdated
if ptq_ds is not None | ||
else None | ||
) | ||
train_ds = train_ds.map(partial(trans_func)) if train_ds is not None else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恢复一下这块,不改变原生代码的逻辑
llm/utils/data.py
Outdated
return features | ||
|
||
|
||
def test_preprocess_function(example, tokenizer, inference_length): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数没用的话删除
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8822 +/- ##
===========================================
+ Coverage 52.81% 52.91% +0.10%
===========================================
Files 677 679 +2
Lines 107943 108403 +460
===========================================
+ Hits 57010 57365 +355
- Misses 50933 51038 +105 ☔ View full report in Codecov by Sentry. |
llm/run_finetune.py
Outdated
from utils.data import convert_example_common | ||
|
||
trans_func = partial(convert_example_common, tokenizer=tokenizer, data_args=data_args) | ||
else: | ||
trans_func = partial(get_convert_example(model), tokenizer=tokenizer, data_args=data_args) | ||
|
||
if data_args.zero_padding: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
删除这段
llm/run_finetune.py
Outdated
if dev_ds is not None | ||
else None | ||
) | ||
dev_ds = dev_ds.map(partial(trans_func)) if dev_ds is not None else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?为什么修改这段
rope_scaling_type: str = field(default=None, metadata={"help": "Rope extension strategy"}) | ||
rope_scaling_factor: float = field(default=None, metadata={"help": "Rope extension scaling factor"}) | ||
strategy_type: str = field(default=None, metadata={"help": "Long sequence strategy type"}) | ||
strategy_name: str = field(default=None, metadata={"help": "Long sequence strategy name"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
llm/utils/data.py
Outdated
|
||
def get_example_pose(example, tokenizer, data_args): | ||
if "src" in example: | ||
source = example["src"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以和写longlora的同学https://github.com/PaddlePaddle/PaddleNLP/pull/8798/files
一起商量一下你们的数据格式到底叫src还是text,并且可以把get_example_pose写成tokenize_autogressive函数里一个分支if pose:return get_example_pose()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
PR changes
Description
Pose + Yarn Algorithm