-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[AutoNLP] add compress #4963
[AutoNLP] add compress #4963
Conversation
Thanks for your contribution! |
Codecov Report
@@ Coverage Diff @@
## develop #4963 +/- ##
===========================================
+ Coverage 47.58% 47.64% +0.05%
===========================================
Files 453 453
Lines 65378 65460 +82
===========================================
+ Hits 31109 31187 +78
- Misses 34269 34273 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
@@ -104,8 +105,8 @@ def supported_languages(self) -> List[str]: | |||
return ["Chinese", "English"] | |||
|
|||
@property | |||
def _default_training_argument(self) -> TrainingArguments: | |||
return TrainingArguments( | |||
def _default_training_argument(self) -> CompressionArguments: |
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.
我感觉还是先维持TrainingArguments吧,好像现在也没有太用到CompressionArguments里的内容。后续我们看考虑接入trainer.compress的时候,再看CompressionArguments
@@ -240,6 +241,7 @@ def _model_candidates(self) -> List[Dict[str, Any]]: | |||
"trainer_type": "PromptTrainer", | |||
"template.prompt": "{'mask'}{'soft'}“{'text': '" + self.text_column + "'}”", | |||
"early_stopping_patience": 5, | |||
"early_stopping_patience": 5, |
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.
remove
@@ -552,29 +558,35 @@ def _preprocess_dataset( | |||
processed_dataset = copy.deepcopy(dataset).map(trans_func, lazy=False) | |||
return processed_dataset | |||
|
|||
def to_taskflow(self, trial_id=None, export_path=None, batch_size=1, precision="fp32"): | |||
def to_taskflow( |
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.
建议当前先把compress和export做成独立的功能。
export -> to_taskflow
compress -> to_taskflow
这两部能不能分开走?即如果一个trial_id已经被export或者compress过了,都可以直接taskflow直接加载推理?
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.
但这么设计,相当于compress出来就只有一个模型,不需要选择。现在只有一个策略没有问题,如果未来有多个策略,那么需要一个可以选择的函数。
我的想法是:train->(compress)->(export[training_path]->taskflow)->export[specify_path],export这个函数是指定路径的,也意味着承载着选择用户最终需要的模型功能。
PR types
Others
PR changes
APIs
Description
新增压缩和预测