Spaces:
Running
on
Zero
Running
on
Zero
Rishi Desai
commited on
Commit
·
9e78a33
1
Parent(s):
40255fe
reames for clarity
Browse files- demo.py +1 -1
- install.py +3 -3
demo.py
CHANGED
@@ -5,7 +5,7 @@ if "HF_DEMO" in os.environ:
|
|
5 |
# Global variable to track if install() has been run; only for deploying on HF space
|
6 |
INSTALLED = False
|
7 |
if not INSTALLED:
|
8 |
-
install(
|
9 |
INSTALLED = True
|
10 |
|
11 |
import gradio as gr
|
|
|
5 |
# Global variable to track if install() has been run; only for deploying on HF space
|
6 |
INSTALLED = False
|
7 |
if not INSTALLED:
|
8 |
+
install(is_hf_space=True)
|
9 |
INSTALLED = True
|
10 |
|
11 |
import gradio as gr
|
install.py
CHANGED
@@ -203,17 +203,17 @@ def install_hfdemo_dependencies():
|
|
203 |
run_cmd("python -m pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124")
|
204 |
run_cmd("python -m pip install -r requirements.txt")
|
205 |
|
206 |
-
# If we're using persistent storage,
|
207 |
HF_CACHE = "./huggingface_cache"
|
208 |
os.environ['HF_HOME'] = HF_CACHE
|
209 |
os.makedirs(HF_CACHE, exist_ok=True)
|
210 |
|
211 |
|
212 |
-
def install(
|
213 |
install_lfs_files()
|
214 |
install_comfyui()
|
215 |
install_custom_nodes()
|
216 |
-
if
|
217 |
install_hfdemo_dependencies()
|
218 |
download_huggingface_models()
|
219 |
download_and_extract_antelopev2()
|
|
|
203 |
run_cmd("python -m pip install torch==2.5.1 torchvision==0.20.1 torchaudio==2.5.1 --index-url https://download.pytorch.org/whl/cu124")
|
204 |
run_cmd("python -m pip install -r requirements.txt")
|
205 |
|
206 |
+
# If we're using persistent storage, change to "/data/huggingface_cache"
|
207 |
HF_CACHE = "./huggingface_cache"
|
208 |
os.environ['HF_HOME'] = HF_CACHE
|
209 |
os.makedirs(HF_CACHE, exist_ok=True)
|
210 |
|
211 |
|
212 |
+
def install(is_hf_space=False):
|
213 |
install_lfs_files()
|
214 |
install_comfyui()
|
215 |
install_custom_nodes()
|
216 |
+
if is_hf_space:
|
217 |
install_hfdemo_dependencies()
|
218 |
download_huggingface_models()
|
219 |
download_and_extract_antelopev2()
|