Download old/models/upload.py from waveshaker/loras_tools: direct link, hf CLI and curl.
- Browser
- Download file 531 Bytes
-
https://huggingface.co/waveshaker/loras_tools/resolve/main/old/models/upload.py
- Command line
-
hf download hf://waveshaker/loras_tools/old/models/upload.py
-
curl -L -o upload.py https://huggingface.co/waveshaker/loras_tools/resolve/main/old/models/upload.py
531 Bytes
| from huggingface_hub import HfApi | |
| # 初始化 API | |
| api = HfApi(token="***") | |
| # 配置文件与仓库信息 | |
| local_folder = r"F:\AI_Models\a\b\c" | |
| repo_id = "waveshaker/character_loras" | |
| path_in_repo = "sd15/WE" | |
| print(f"开始上传文件夹到远程路径: {path_in_repo} ...") | |
| # 上传整个文件夹 | |
| api.upload_folder( | |
| folder_path=local_folder, | |
| repo_id=repo_id, | |
| repo_type="model", | |
| path_in_repo=path_in_repo, | |
| # 动态提交信息 | |
| commit_message=f"Upload files to {path_in_repo}" | |
| ) | |
| print("上传完成!") |