浏览代码

fix: silence deprecation in huggingface snapshot_download function (#8150)

### What problem does this PR solve?

fixes the following deprecation emitted from `download_deps.py`: 

```
UserWarning: `local_dir_use_symlinks` parameter is deprecated and will be ignored. The process to download files to a local folder has been updated and do not rely on symlinks anymore. You only need to pass a destination folder as`local_dir`
```

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.19.1
Gifford Nowland 4 个月前
父节点
当前提交
ab67292aa3
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      download_deps.py

+ 2
- 2
download_deps.py 查看文件

def download_model(repo_id): def download_model(repo_id):
local_dir = os.path.abspath(os.path.join("huggingface.co", repo_id)) local_dir = os.path.abspath(os.path.join("huggingface.co", repo_id))
os.makedirs(local_dir, exist_ok=True) os.makedirs(local_dir, exist_ok=True)
snapshot_download(repo_id=repo_id, local_dir=local_dir, local_dir_use_symlinks=False)
snapshot_download(repo_id=repo_id, local_dir=local_dir)




if __name__ == "__main__": if __name__ == "__main__":


for repo_id in repos: for repo_id in repos:
print(f"Downloading huggingface repo {repo_id}...") print(f"Downloading huggingface repo {repo_id}...")
download_model(repo_id)
download_model(repo_id)

正在加载...
取消
保存