Download scripts/run_elf_owt_c64r512.sh from jyliuAI/diffusion_baseline: direct link, hf CLI and curl.
- Browser
- Download file 2.21 kB
-
https://huggingface.co/jyliuAI/diffusion_baseline/resolve/main/scripts/run_elf_owt_c64r512.sh
- Command line
-
hf download hf://jyliuAI/diffusion_baseline/scripts/run_elf_owt_c64r512.sh
-
curl -L -o run_elf_owt_c64r512.sh https://huggingface.co/jyliuAI/diffusion_baseline/resolve/main/scripts/run_elf_owt_c64r512.sh
2.21 kB
| # Public ELF OWT conditional run with a text-level 64-prompt/512-response contract. | |
| set -euo pipefail | |
| root="${DLB_ROOT:-$(CDPATH= cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)}" | |
| python_bin="${ELF_PYTHON:-python}" | |
| steps_list=(1 2 4 8 16 32 1024) | |
| mode="${1:-generate}" | |
| case "$mode" in generate|evaluate|timing) ;; *) echo "usage: $0 {generate|evaluate|timing}" >&2; exit 2 ;; esac | |
| export HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 WANDB_MODE=disabled PYTHONDONTWRITEBYTECODE=1 | |
| quality_root="${ELF_R512_RESULTS:-$root/results/elf-owt-c64-r512}" | |
| input="$root/data/elf/owt-prefix.jsonl" | |
| if [[ "$mode" == generate ]]; then | |
| for steps in "${steps_list[@]}"; do | |
| output="$quality_root/quality/owt-prefix/c64-text-t5/steps_${steps}/seed_42/compile_0" | |
| if [[ -e "$output" ]]; then | |
| echo "Refusing to overwrite existing output: $output" >&2 | |
| exit 2 | |
| fi | |
| env ELF_PYTHON="$python_bin" DLB_ROOT="$root" \ | |
| "$python_bin" "$root/scripts/run_elf.py" generate \ | |
| --root "$root" --task owt-prefix --steps "$steps" --seed 42 \ | |
| --num-samples 1024 --batch-size 8 --input "$input" \ | |
| --output "$output" --diversity | |
| done | |
| elif [[ "$mode" == evaluate ]]; then | |
| "$python_bin" "$root/scripts/evaluate_elf_owt_c64r512.py" \ | |
| --root "$root" --input-root "$quality_root" \ | |
| --output "$quality_root/evaluation-r512" --response-tokens 512 --batch-size 8 | |
| else | |
| : "${CUDA_VISIBLE_DEVICES:?Set CUDA_VISIBLE_DEVICES to one physical GPU before timing}" | |
| timing_root="${ELF_R512_TIMING_RESULTS:-$root/results/elf-timing-c64r512-$(date -u +%Y%m%dT%H%M%S)-$$}" | |
| for steps in "${steps_list[@]}"; do | |
| output="$timing_root/timing/owt-prefix/c64-text-t5/steps_${steps}/seed_42/compile_0/prompt_0" | |
| env ELF_PYTHON="$python_bin" DLB_ROOT="$root" \ | |
| "$python_bin" "$root/scripts/run_elf.py" timing \ | |
| --root "$root" --task owt-prefix --steps "$steps" --seed 42 \ | |
| --batch-size 1 --warmups 5 --repeats 32 --timing-prompt-index 0 \ | |
| --input "$input" --output "$output" | |
| done | |
| "$python_bin" "$root/scripts/summarize_elf.py" --results "$timing_root" \ | |
| --output "$timing_root/summary.csv" | |
| echo "TIMING SUMMARY: $timing_root/summary.csv" | |
| fi | |