Skip to content

Commit

Permalink
修复整合包大小翻倍的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
chn-lee-yumi committed Jan 17, 2025
1 parent 111b6bd commit c7a5e94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/windows-pack-large.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ jobs:
- name: Compress (has bug)
run: Compress-Archive -CompressionLevel NoCompression -LiteralPath MaterialSearchWindows -DestinationPath MaterialSearchWindows.zip

# 下载模型的时候snapshot是链接到blobs的,但压缩的时候会将blobs和snapshot都压缩一次,导致解压后模型变成双倍大小。下面是临时解决办法,不过有点bug(目录不对),所以暂时不解决
# 下载模型的时候snapshot是链接到blobs的,但压缩的时候会将blobs和snapshot都压缩一次,导致解压后模型变成双倍大小。另外新版本huggingface会下载model.safetensors,多占一倍空间,因此要删掉
- name: Unzip (solve zip issue)
run: Expand-Archive MaterialSearchWindows.zip -DestinationPath MaterialSearch_tmp; rm MaterialSearchWindows.zip; rm -r MaterialSearch_tmp/MaterialSearchWindows/huggingface/hub/models--OFA-Sys--chinese-clip-vit-large-patch14-336px/blobs
run: |
Expand-Archive MaterialSearchWindows.zip -DestinationPath MaterialSearch_tmp
rm MaterialSearchWindows.zip
rm -r MaterialSearch_tmp/MaterialSearchWindows/huggingface/hub/models--OFA-Sys--chinese-clip-vit-large-patch14-336px/blobs
Get-ChildItem -Recurse -Filter "model.safetensors" | Remove-Item -Force
# 改用7z压缩,提高压缩率
- name: Compress (solve zip issue)
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/windows-pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ jobs:
- name: Compress (has bug)
run: Compress-Archive -CompressionLevel NoCompression -LiteralPath MaterialSearchWindows -DestinationPath MaterialSearchWindows.zip

# 下载模型的时候snapshot是链接到blobs的,但压缩的时候会将blobs和snapshot都压缩一次,导致解压后模型变成双倍大小。下面是临时解决办法,不过有点bug(目录不对),所以暂时不解决
# 下载模型的时候snapshot是链接到blobs的,但压缩的时候会将blobs和snapshot都压缩一次,导致解压后模型变成双倍大小。另外新版本huggingface会下载model.safetensors,多占一倍空间,因此要删掉
- name: Unzip (solve zip issue)
run: Expand-Archive MaterialSearchWindows.zip -DestinationPath MaterialSearch_tmp; rm MaterialSearchWindows.zip; rm -r MaterialSearch_tmp/MaterialSearchWindows/huggingface/hub/models--OFA-Sys--chinese-clip-vit-base-patch16/blobs
run: |
Expand-Archive MaterialSearchWindows.zip -DestinationPath MaterialSearch_tmp
rm MaterialSearchWindows.zip
rm -r MaterialSearch_tmp/MaterialSearchWindows/huggingface/hub/models--OFA-Sys--chinese-clip-vit-base-patch16/blobs
Get-ChildItem -Recurse -Filter "model.safetensors" | Remove-Item -Force
# 改用7z压缩,提高压缩率
- name: Compress (solve zip issue)
Expand Down

0 comments on commit c7a5e94

Please sign in to comment.