Spaces:
Running
on
Zero
Running
on
Zero
IceClear
commited on
Commit
Β·
d62797d
1
Parent(s):
367bee6
update
Browse files- app.py +3 -3
- build_apex.sh +45 -0
app.py
CHANGED
|
@@ -111,7 +111,7 @@ pretrain_model_url = {
|
|
| 111 |
'dit': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/seedvr2_ema_3b.pth',
|
| 112 |
'pos_emb': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/pos_emb.pt',
|
| 113 |
'neg_emb': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/neg_emb.pt',
|
| 114 |
-
'apex': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/apex-0.1-
|
| 115 |
}
|
| 116 |
# download weights
|
| 117 |
if not os.path.exists('./ckpts/seedvr2_ema_3b.pth'):
|
|
@@ -122,10 +122,10 @@ if not os.path.exists('./pos_emb.pt'):
|
|
| 122 |
load_file_from_url(url=pretrain_model_url['pos_emb'], model_dir='./', progress=True, file_name=None)
|
| 123 |
if not os.path.exists('./neg_emb.pt'):
|
| 124 |
load_file_from_url(url=pretrain_model_url['neg_emb'], model_dir='./', progress=True, file_name=None)
|
| 125 |
-
if not os.path.exists('./apex-0.1-
|
| 126 |
load_file_from_url(url=pretrain_model_url['apex'], model_dir='./', progress=True, file_name=None)
|
| 127 |
|
| 128 |
-
subprocess.run(shlex.split("pip install apex-0.1-
|
| 129 |
print(f"β
setup completed Apex")
|
| 130 |
|
| 131 |
# download images
|
|
|
|
| 111 |
'dit': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/seedvr2_ema_3b.pth',
|
| 112 |
'pos_emb': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/pos_emb.pt',
|
| 113 |
'neg_emb': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/neg_emb.pt',
|
| 114 |
+
'apex': 'https://huggingface.co/ByteDance-Seed/SeedVR2-3B/resolve/main/apex-0.1-cp310-cp310-linux_x86_64.whl'
|
| 115 |
}
|
| 116 |
# download weights
|
| 117 |
if not os.path.exists('./ckpts/seedvr2_ema_3b.pth'):
|
|
|
|
| 122 |
load_file_from_url(url=pretrain_model_url['pos_emb'], model_dir='./', progress=True, file_name=None)
|
| 123 |
if not os.path.exists('./neg_emb.pt'):
|
| 124 |
load_file_from_url(url=pretrain_model_url['neg_emb'], model_dir='./', progress=True, file_name=None)
|
| 125 |
+
if not os.path.exists('./apex-0.1-cp310-cp310-linux_x86_64.whl'):
|
| 126 |
load_file_from_url(url=pretrain_model_url['apex'], model_dir='./', progress=True, file_name=None)
|
| 127 |
|
| 128 |
+
subprocess.run(shlex.split("pip install apex-0.1-cp310-cp310-linux_x86_64.whl"))
|
| 129 |
print(f"β
setup completed Apex")
|
| 130 |
|
| 131 |
# download images
|
build_apex.sh
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
set -e
|
| 3 |
+
|
| 4 |
+
# π§Ύ Config
|
| 5 |
+
# APEX_COMMIT=f3a960f80244cf9e80558ab30f7f7e8cbf03c0a0 # Known stable commit
|
| 6 |
+
|
| 7 |
+
echo "π§Ή Cleaning any previous apex build..."
|
| 8 |
+
rm -rf apex
|
| 9 |
+
rm -rf *.egg-info build dist
|
| 10 |
+
|
| 11 |
+
echo "π₯ Cloning NVIDIA/apex..."
|
| 12 |
+
git clone https://github.com/NVIDIA/apex.git
|
| 13 |
+
cd apex
|
| 14 |
+
# git checkout $APEX_COMMIT
|
| 15 |
+
|
| 16 |
+
echo "π Installing build dependencies..."
|
| 17 |
+
sudo apt-get update
|
| 18 |
+
sudo apt-get install -y \
|
| 19 |
+
build-essential \
|
| 20 |
+
ninja-build \
|
| 21 |
+
python3-dev \
|
| 22 |
+
libffi-dev \
|
| 23 |
+
libncurses5-dev \
|
| 24 |
+
libncursesw5-dev \
|
| 25 |
+
libreadline-dev \
|
| 26 |
+
libssl-dev \
|
| 27 |
+
libsqlite3-dev \
|
| 28 |
+
zlib1g-dev \
|
| 29 |
+
libbz2-dev \
|
| 30 |
+
liblzma-dev \
|
| 31 |
+
git
|
| 32 |
+
|
| 33 |
+
echo "π Upgrading pip and wheel..."
|
| 34 |
+
pip install -U pip setuptools wheel
|
| 35 |
+
|
| 36 |
+
echo "π§ͺ Verifying PyTorch + CUDA availability..."
|
| 37 |
+
python -c "import torch; print('PyTorch:', torch.__version__, '| CUDA:', torch.version.cuda)"
|
| 38 |
+
|
| 39 |
+
echo "π§ Building Apex with CUDA and C++ extensions..."
|
| 40 |
+
python setup.py bdist_wheel --cuda_ext --cpp_ext
|
| 41 |
+
|
| 42 |
+
echo "β
Done! Built wheel:"
|
| 43 |
+
ls -lh dist/*.whl
|
| 44 |
+
|
| 45 |
+
cd ..
|