Spaces:
Running on Zero
Running on Zero
multimodalart HF Staff
MVRD demo: vendored llava package, runtime ckpt fetch, VSI-Bench example video
2b1ab22 verified Download llava/model/multimodal_spatial_encoder/builder.py from hugging-apps/mvrd-spatial-reasoning: direct link, hf CLI and curl.
- Browser
- Download file 738 Bytes
-
https://huggingface.co/spaces/hugging-apps/mvrd-spatial-reasoning/resolve/main/llava/model/multimodal_spatial_encoder/builder.py
- Command line
-
hf download hf://spaces/hugging-apps/mvrd-spatial-reasoning/llava/model/multimodal_spatial_encoder/builder.py
-
curl -L -o builder.py https://huggingface.co/spaces/hugging-apps/mvrd-spatial-reasoning/resolve/main/llava/model/multimodal_spatial_encoder/builder.py
738 Bytes
| import os | |
| import sys | |
| # Get the directory containing the current script | |
| script_dir = os.path.dirname(os.path.abspath(__file__)) | |
| # Go up four levels to reach VLM-3R/ | |
| root = os.path.abspath(os.path.join(script_dir, '..', '..', '..')) | |
| def build_spatial_tower(spatial_tower_cfg, **kwargs): | |
| spatial_tower = getattr(spatial_tower_cfg, "mm_spatial_tower", getattr(spatial_tower_cfg, "spatial_tower", 'spann3r')) | |
| vggt_path = os.path.join(root, 'vggt') | |
| if vggt_path not in sys.path: | |
| sys.path.append(vggt_path) | |
| # Use relative import for the encoder wrapper/adapter file | |
| from .vggt_spatial_encoder import VGGTSpatialTower | |
| return VGGTSpatialTower(spatial_tower, spatial_tower_cfg=spatial_tower_cfg, delay_load=False) | |