Spaces:
Running on Zero
Running on Zero
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -110,7 +110,7 @@ def _topk_dict(logits: torch.Tensor, k: int = 5) -> dict:
|
|
| 110 |
return {IMAGENET_CLASSES[int(i)]: float(v) for v, i in zip(values, indices)}
|
| 111 |
|
| 112 |
|
| 113 |
-
@spaces.GPU(duration=
|
| 114 |
def classify(
|
| 115 |
image: Image.Image,
|
| 116 |
variant: str = DEFAULT_VARIANT,
|
|
@@ -216,7 +216,7 @@ EXAMPLES = [
|
|
| 216 |
["examples/monstera_plant.jpg"],
|
| 217 |
]
|
| 218 |
|
| 219 |
-
with gr.Blocks(
|
| 220 |
with gr.Column(elem_id="col-container"):
|
| 221 |
gr.Markdown(
|
| 222 |
"""# ProgResViT — adaptive-compute image classification
|
|
@@ -278,4 +278,4 @@ reusing the tokens produced in round 1.
|
|
| 278 |
)
|
| 279 |
|
| 280 |
if __name__ == "__main__":
|
| 281 |
-
demo.launch(mcp_server=True)
|
|
|
|
| 110 |
return {IMAGENET_CLASSES[int(i)]: float(v) for v, i in zip(values, indices)}
|
| 111 |
|
| 112 |
|
| 113 |
+
@spaces.GPU(duration=15)
|
| 114 |
def classify(
|
| 115 |
image: Image.Image,
|
| 116 |
variant: str = DEFAULT_VARIANT,
|
|
|
|
| 216 |
["examples/monstera_plant.jpg"],
|
| 217 |
]
|
| 218 |
|
| 219 |
+
with gr.Blocks() as demo:
|
| 220 |
with gr.Column(elem_id="col-container"):
|
| 221 |
gr.Markdown(
|
| 222 |
"""# ProgResViT — adaptive-compute image classification
|
|
|
|
| 278 |
)
|
| 279 |
|
| 280 |
if __name__ == "__main__":
|
| 281 |
+
demo.launch(theme=gr.themes.Citrus(), css=CSS, mcp_server=True)
|