Skip to content

Conversation

@gongel
Copy link
Member

@gongel gongel commented Feb 22, 2023

PR types

optimization

PR changes

APIs

Description

from paddlenlp import  Taskflow
summarizer = Taskflow("text_summarization", model="IDEA-CCNL/Randeng-Pegasus-523M-Summary-Chinese-V1")

@gongel gongel requested review from linjieccc and wawltor February 22, 2023 07:50
@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Merging #4933 (2d8d78c) into develop (75f3130) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #4933      +/-   ##
===========================================
- Coverage    46.35%   46.34%   -0.01%     
===========================================
  Files          448      448              
  Lines        64643    64646       +3     
===========================================
- Hits         29964    29963       -1     
- Misses       34679    34683       +4     
Impacted Files Coverage Δ
paddlenlp/taskflow/taskflow.py 80.45% <ø> (ø)
paddlenlp/trainer/trainer.py 59.84% <0.00%> (-0.31%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@linjieccc linjieccc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gongel Hi, 当前还少了两个步骤

  1. 配置模型相关文件resource_files_names及下载链接resource_files_urls,在__init__中使用self._check_task_files()触发文件下载

可以参考这里的写法:https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/taskflow/feature_extraction.py#L70

  1. 改为from_pretrained(self._task_path)来支持加载微调之后的模型
    https://github.com/PaddlePaddle/PaddleNLP/blob/develop/paddlenlp/taskflow/text_summarization.py#L83
self._model = AutoModelForConditionalGeneration.from_pretrained(self._task_path)

@gongel
Copy link
Member Author

gongel commented Feb 23, 2023

经讨论:Q2升级完后再做统一修改。

Copy link
Contributor

@linjieccc linjieccc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gongel gongel merged commit a345ca7 into PaddlePaddle:develop Feb 27, 2023
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.

[Question]: 对于摘要的这个预训练大模型更改配置来替换模型时,会报出错误

2 participants