Update Deploy - now use fetch weight

This commit is contained in:
2026-07-05 10:00:20 +00:00
parent 6232887ebd
commit 5265e802da
2 changed files with 21 additions and 2 deletions
+10 -1
View File
@@ -71,7 +71,16 @@ print('torch', torch.__version__, 'cuda=', torch.version.cuda)"
默认用到三个模型:`hustvl/vitmatte-base-composition-1k`(抠图)、
`ZhengPeng7/BiRefNet`(默认分割)、`skytnt/anime-seg`(可选分割)。
第四个模型 `ZhengPeng7/BiRefNet_HR-matting`(约 425 MB)只有在启用 **cross-check(交叉校验)
否决**时才需要——见本节末尾说明。下面两种放法**二选一**。
否决**时才需要——见本节末尾说明。
**一键方式(推荐)**:跑仓库自带脚本(无参数),经 hf-mirror 把所有模型下到 `models/`
(绕过代理、禁用 Xet、已存在的文件夹自动跳过)。跑完主 app 即离线全功能可用:
```bash
python scripts/fetch_weights.py
```
下面两种手动放法用于更精细的控制(比如共享 HF 缓存、只下部分模型),**二选一**。
### 方案 A —— HuggingFace 缓存 + 离线模式(推荐)