| 1 | #!/bin/bash |
| 2 | # Launch Echo-WM Gradio interface |
| 3 | |
| 4 | set -e |
| 5 | |
| 6 | # Default paths (can be overridden by environment variables) |
| 7 | CHECKPOINT="${CHECKPOINT:-checkpoints/echo-wm-base.safetensors}" |
| 8 | GEMMA_PATH="${GEMMA_PATH:-checkpoints/gemma-3}" |
| 9 | CONFIG="${CONFIG:-configs/inference_wm.yaml}" |
| 10 | PORT="${PORT:-7860}" |
| 11 | |
| 12 | # Check if checkpoint exists |
| 13 | if [ ! -f "$CHECKPOINT" ]; then |
| 14 | echo "Error: Checkpoint not found at $CHECKPOINT" |
| 15 | echo "Please download the checkpoint first:" |
| 16 | echo " huggingface-cli download Echo-Team/Echo-WM --local-dir checkpoints/" |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | # Check if gemma exists |
| 21 | if [ ! -d "$GEMMA_PATH" ]; then |
| 22 | echo "Error: Gemma model not found at $GEMMA_PATH" |
| 23 | echo "Please download the model first." |
| 24 | exit 1 |
| 25 | fi |
| 26 | |
| 27 | # Launch |
| 28 | echo "Starting Echo-WM Gradio interface..." |
| 29 | echo " Checkpoint: $CHECKPOINT" |
| 30 | echo " Gemma: $GEMMA_PATH" |
| 31 | echo " Config: $CONFIG" |
| 32 | echo " Port: $PORT" |
| 33 | echo "" |
| 34 | echo "The server is ready once the '[server] Serving on ...' line appears below." |
| 35 | echo "" |
| 36 | |
| 37 | python gradio_echo_wm.py \ |
| 38 | --checkpoint "$CHECKPOINT" \ |
| 39 | --gemma-path "$GEMMA_PATH" \ |
| 40 | --config "$CONFIG" \ |
| 41 | --port "$PORT" \ |
| 42 | "$@" |
| 43 |