Skip to content
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

[FIX Download] update converted logic & fix hf hub download subfolder bug #7911

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

JunnYu
Copy link
Member

@JunnYu JunnYu commented Jan 27, 2024

PR types

PR changes

Description

  1. hf hub 下载的时候不需要 给filename拼subfolder,否则会出现 subfolder/subfolder/filename
  2. 权重转换的时候自动检测同级目录是否存在 model_state.pdparams文件,如果存在就直接使用并load_file成为state_dict
  3. 加载转换后的paddle权重文件的逻辑进行修改,先是通过检测与torch同级目录的paddle文件是否存在
    if not os.path.exists(converted_paddle_weights):
    ,如果存在就直接加载(原先的时候第二次加载是不会走这里的逻辑,现在统一一下,走这里)

@JunnYu JunnYu requested a review from ZHUI January 27, 2024 03:21
Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Attention: 8 lines in your changes are missing coverage. Please review.

Comparison is base (fff730e) 57.28% compared to head (bb6c735) 57.27%.

Files Patch % Lines
paddlenlp/transformers/model_utils.py 42.85% 8 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.7    #7911      +/-   ##
===============================================
- Coverage        57.28%   57.27%   -0.01%     
===============================================
  Files              584      584              
  Lines            87747    87747              
===============================================
- Hits             50262    50257       -5     
- Misses           37485    37490       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZHUI ZHUI merged commit 797efa6 into PaddlePaddle:release/2.7 Jan 29, 2024
5 of 7 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