Last active
April 3, 2026 14:11
-
-
Save 5shekel/03f3da73bc14d1419eee4049f103b832 to your computer and use it in GitHub Desktop.
start nvidia kimodo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| #based on https://huggingface.co/spaces/nvidia/Kimodo/blob/main/start.sh | |
| cd /workspace/ | |
| # Cause the script to exit on failure. | |
| set -eo pipefail | |
| # Activate the main virtual environment | |
| . /venv/main/bin/activate | |
| pip install hf | |
| hf auth login --token $HF_TOKEN | |
| #pip | |
| pip install "kimodo[all] @ git+https://github.com/nv-tlabs/kimodo.git" | |
| # lauching text encoder | |
| echo "Starting text-encoder on :9550 ..." | |
| kimodo_textencoder & | |
| TEXT_ENCODER_PID=$! | |
| # make sure to kill it if the demo really crash | |
| cleanup() { | |
| echo "Shutting down text-encoder (pid=${TEXT_ENCODER_PID}) ..." | |
| kill "${TEXT_ENCODER_PID}" >/dev/null 2>&1 || true | |
| } | |
| trap cleanup EXIT | |
| # waiting for the text encoder to be fully loaded | |
| echo "Waiting for text-encoder health ..." | |
| for i in $(seq 1 1200); do | |
| if curl -fsS "http://127.0.0.1:9550/" >/dev/null 2>&1; then | |
| echo "Text-encoder is up." | |
| break | |
| fi | |
| sleep 1 | |
| if [[ $i -eq 1200 ]]; then | |
| echo "ERROR: text-encoder did not become healthy on http://127.0.0.1:9550/ within 1800" >&2 | |
| exit 1 | |
| fi | |
| done | |
| # launching the demo | |
| echo "Starting demo on :7860 ..." | |
| exec kimodo_demo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment