Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -173,10 +173,8 @@ def prefetch_one_model(repo_id_or_path: str | Path | None, label: str) -> bool:
|
|
| 173 |
def prefetch_model_assets() -> None:
|
| 174 |
"""
|
| 175 |
Download model files before the ZeroGPU function is called.
|
| 176 |
-
|
| 177 |
This does not instantiate the models. It only ensures files are already in
|
| 178 |
the Hugging Face cache, so download time is not counted inside @spaces.GPU.
|
| 179 |
-
|
| 180 |
Model objects are cached in demo/real_world_pipeline.py after their first
|
| 181 |
construction in the running process.
|
| 182 |
"""
|
|
@@ -380,14 +378,10 @@ with gr.Blocks(title="SynLayers Real-World Demo") as demo:
|
|
| 380 |
gr.Markdown(
|
| 381 |
"""
|
| 382 |
# SynLayers Real-World Decomposition
|
| 383 |
-
|
| 384 |
Upload a single image and run the full pipeline in one step:
|
| 385 |
-
|
| 386 |
1. VLM for whole-caption + bounding-box detection
|
| 387 |
2. SynLayers real-image layer decomposition
|
| 388 |
-
|
| 389 |
This Space can run either on a dedicated GPU Space or on Hugging Face ZeroGPU.
|
| 390 |
-
|
| 391 |
The first request may still take time while Python modules and model objects are initialized.
|
| 392 |
Model files are prefetched during Space startup, and initialized model objects are reused while the process stays alive.
|
| 393 |
"""
|
|
|
|
| 173 |
def prefetch_model_assets() -> None:
|
| 174 |
"""
|
| 175 |
Download model files before the ZeroGPU function is called.
|
|
|
|
| 176 |
This does not instantiate the models. It only ensures files are already in
|
| 177 |
the Hugging Face cache, so download time is not counted inside @spaces.GPU.
|
|
|
|
| 178 |
Model objects are cached in demo/real_world_pipeline.py after their first
|
| 179 |
construction in the running process.
|
| 180 |
"""
|
|
|
|
| 378 |
gr.Markdown(
|
| 379 |
"""
|
| 380 |
# SynLayers Real-World Decomposition
|
|
|
|
| 381 |
Upload a single image and run the full pipeline in one step:
|
|
|
|
| 382 |
1. VLM for whole-caption + bounding-box detection
|
| 383 |
2. SynLayers real-image layer decomposition
|
|
|
|
| 384 |
This Space can run either on a dedicated GPU Space or on Hugging Face ZeroGPU.
|
|
|
|
| 385 |
The first request may still take time while Python modules and model objects are initialized.
|
| 386 |
Model files are prefetched during Space startup, and initialized model objects are reused while the process stays alive.
|
| 387 |
"""
|