Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,21 @@ num_frames, width, height = 49, 832, 480
|
|
15 |
gpu_id = 0
|
16 |
device = f'cuda:{gpu_id}' if torch.cuda.is_available() else 'cpu'
|
17 |
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
rmbg_model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True)
|
21 |
torch.set_float32_matmul_precision(['high', 'highest'][0])
|
|
|
15 |
gpu_id = 0
|
16 |
device = f'cuda:{gpu_id}' if torch.cuda.is_available() else 'cpu'
|
17 |
|
18 |
+
from huggingface_hub import snapshot_download, hf_hub_download
|
19 |
+
snapshot_download(
|
20 |
+
repo_id="briaai/RMBG-2.0",
|
21 |
+
local_dir="ckpt/RMBG-2.0",
|
22 |
+
local_dir_use_symlinks=False,
|
23 |
+
resume_download=True,
|
24 |
+
repo_type="model"
|
25 |
+
)
|
26 |
+
snapshot_download( # 下载整个仓库
|
27 |
+
repo_id="alibaba-pai/Wan2.1-Fun-1.3B-Control",
|
28 |
+
local_dir="ckpt/Wan2.1-Fun-1.3B-Control",
|
29 |
+
local_dir_use_symlinks=False,
|
30 |
+
resume_download=True,
|
31 |
+
repo_type="model"
|
32 |
+
)
|
33 |
|
34 |
rmbg_model = AutoModelForImageSegmentation.from_pretrained('briaai/RMBG-2.0', trust_remote_code=True)
|
35 |
torch.set_float32_matmul_precision(['high', 'highest'][0])
|