Spaces:
Running on Zero
Running on Zero
Revert "Fix extract_features_value_attention and add _get_all_blocks"
Browse filesThis reverts commit f55b5f107d6b313b89520b4fc260a34207adc461.
app.py
CHANGED
|
@@ -36,15 +36,7 @@ DEFAULT_VARIANT = "TIPS v2 β L/14"
|
|
| 36 |
|
| 37 |
def _device():
|
| 38 |
return torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 39 |
-
|
| 40 |
-
if hasattr(model_image, "chunked_blocks") and model_image.chunked_blocks:
|
| 41 |
-
blocks = []
|
| 42 |
-
for chunk in model_image.blocks:
|
| 43 |
-
for blk in chunk:
|
| 44 |
-
if not isinstance(blk, torch.nn.Identity):
|
| 45 |
-
blocks.append(blk)
|
| 46 |
-
return blocks
|
| 47 |
-
return list(model_image.blocks)
|
| 48 |
|
| 49 |
# ββ Pascal Context (59 classes) βββββββββββββββββββββββββββββββββββββββββββββ
|
| 50 |
|
|
|
|
| 36 |
|
| 37 |
def _device():
|
| 38 |
return torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 39 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
# ββ Pascal Context (59 classes) βββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
|