Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ import argparse
|
|
| 13 |
import gradio as gr
|
| 14 |
import spaces
|
| 15 |
from huggingface_hub import hf_hub_url
|
| 16 |
-
import
|
| 17 |
|
| 18 |
def parse_args():
|
| 19 |
parser = argparse.ArgumentParser()
|
|
@@ -204,12 +204,15 @@ with gr.Blocks() as demo:
|
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
-
def
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
|
|
|
|
|
|
| 212 |
def download_model():
|
|
|
|
| 213 |
urls = [
|
| 214 |
'https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_a.safetensors',
|
| 215 |
'https://huggingface.co/stabilityai/StableWurst/resolve/main/previewer.safetensors',
|
|
@@ -219,7 +222,7 @@ def download_model():
|
|
| 219 |
'https://huggingface.co/roubaofeipi/UltraPixel/blob/main/ultrapixel_t2i.safetensors'
|
| 220 |
]
|
| 221 |
for file_url in urls:
|
| 222 |
-
|
| 223 |
if __name__ == "__main__":
|
| 224 |
|
| 225 |
args = parse_args()
|
|
|
|
| 13 |
import gradio as gr
|
| 14 |
import spaces
|
| 15 |
from huggingface_hub import hf_hub_url
|
| 16 |
+
import subprocess
|
| 17 |
|
| 18 |
def parse_args():
|
| 19 |
parser = argparse.ArgumentParser()
|
|
|
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
+
def download_with_wget(url, save_path):
|
| 208 |
+
|
| 209 |
+
try:
|
| 210 |
+
subprocess.run(['wget', url, '-O', save_path], check=True)
|
| 211 |
+
print(f"Downloaded to {save_path}")
|
| 212 |
+
except subprocess.CalledProcessError as e:
|
| 213 |
+
print(f"Error downloading file: {e}")
|
| 214 |
def download_model():
|
| 215 |
+
|
| 216 |
urls = [
|
| 217 |
'https://huggingface.co/stabilityai/StableWurst/resolve/main/stage_a.safetensors',
|
| 218 |
'https://huggingface.co/stabilityai/StableWurst/resolve/main/previewer.safetensors',
|
|
|
|
| 222 |
'https://huggingface.co/roubaofeipi/UltraPixel/blob/main/ultrapixel_t2i.safetensors'
|
| 223 |
]
|
| 224 |
for file_url in urls:
|
| 225 |
+
download_with_wget(file_url, 'models')
|
| 226 |
if __name__ == "__main__":
|
| 227 |
|
| 228 |
args = parse_args()
|