Download code/1027_run/setup_fix8.sh from yqi19/dagger: direct link, hf CLI and curl.
- Browser
- Download file 2.79 kB
-
https://huggingface.co/datasets/yqi19/dagger/resolve/main/code/1027_run/setup_fix8.sh
- Command line
-
hf download hf://datasets/yqi19/dagger/code/1027_run/setup_fix8.sh
-
curl -L -o setup_fix8.sh https://huggingface.co/datasets/yqi19/dagger/resolve/main/code/1027_run/setup_fix8.sh
2.79 kB
| # Fix: install python-dateutil in simfoundry + download full behavior-1k-assets (has /systems) | |
| set -uo pipefail | |
| ROOT=/lustre/fsw/portfolios/nvr/users/jtremblay/yu | |
| CONDA=$ROOT/miniconda3 | |
| SPY=$CONDA/envs/simfoundry/bin/python | |
| B1K=$ROOT/SimFoundry/deps/BEHAVIOR-1K | |
| DS=$B1K/datasets | |
| LOG=$ROOT/1027_run/logs/setup_fix8.log | |
| mkdir -p $ROOT/1027_run/logs | |
| exec > >(tee -a $LOG) 2>&1 | |
| export PATH=$CONDA/bin:/usr/local/bin:/usr/bin:/bin | |
| export HOME=/root | |
| export HF_TOKEN=<YOUR_HF_TOKEN> | |
| source $CONDA/etc/profile.d/conda.sh | |
| log() { echo "== $(date '+%F %T') $*"; } | |
| # ββ 1. Fix missing python-dateutil (matplotlib dep) in simfoundry βββββββββββββ | |
| log "Installing python-dateutil in simfoundry env" | |
| $SPY -m pip install --no-cache-dir "python-dateutil>=2.8" | |
| log "pip exit $?" | |
| # Verify matplotlib now works | |
| $SPY -c "import matplotlib; print('matplotlib', matplotlib.__version__)" && log "matplotlib OK" | |
| # ββ 2. Download full behavior-1k-assets (contains /systems) ββββββββββββββββββ | |
| if [ ! -d $DS/behavior-1k-assets/systems ]; then | |
| log "Downloading full behavior-1k-assets (no systems dir found)..." | |
| export OMNIGIBSON_DATA_PATH=$DS | |
| # Remove the incomplete install so OmniGibson won't skip it | |
| rm -rf $DS/behavior-1k-assets | |
| $SPY -c " | |
| import os | |
| os.environ['OMNIGIBSON_DATA_PATH'] = '$DS' | |
| os.environ['HF_TOKEN'] = os.environ.get('HF_TOKEN', '') | |
| # Use hf_hub_download directly to get the latest zip (not the rc1 version) | |
| import zipfile, tempfile, shutil | |
| from huggingface_hub import hf_hub_download | |
| print('Downloading behavior-1k-assets.zip (latest)...') | |
| tmpdir = tempfile.mkdtemp() | |
| local_path = hf_hub_download( | |
| repo_id='behavior-1k/zipped-datasets', | |
| filename='behavior-1k-assets.zip', | |
| repo_type='dataset', | |
| local_dir=tmpdir, | |
| token=os.environ.get('HF_TOKEN'), | |
| ) | |
| print(f'Downloaded to {local_path}, extracting...') | |
| target = '$DS/behavior-1k-assets' | |
| os.makedirs(target, exist_ok=True) | |
| with zipfile.ZipFile(local_path, 'r') as z: | |
| z.extractall(target) | |
| shutil.rmtree(tmpdir) | |
| print('Extraction done') | |
| import os as _os | |
| print('Contents:', _os.listdir(target)) | |
| " | |
| log "download/extract exit $?" | |
| else | |
| log "behavior-1k-assets/systems already present, skipping download" | |
| fi | |
| log "Verifying systems dir:" | |
| ls $DS/behavior-1k-assets/ 2>/dev/null | |
| ls $DS/behavior-1k-assets/systems/ 2>/dev/null | head -5 | |
| # ββ 3. Quick import check βββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| log "Checking omnigibson import..." | |
| OMNIGIBSON_DATA_PATH=$DS OMNI_KIT_ACCEPT_EULA=YES \ | |
| $SPY -c "import omnigibson; print('omnigibson import OK')" 2>&1 | tail -3 | |
| log "ALL DONE" | |