#!/usr/bin/env bash # Copy the modules the Space needs out of the repo. # # A Space is a separate git repo, so it cannot import from `../scripts`. The # copies are deliberately NOT tracked here: two tracked copies of # `ltx_packed_codec.py` would drift, and the one that drifts is always the one # nobody is running locally. Run this before uploading. set -euo pipefail cd "$(dirname "$0")" MODULES=(ltx_av_generate ltx_av_guide ltx_prompt_encoder ltx_render_clips ltx_conditioning_dump ltx_prompt_embedding_gate ltx_packed_codec ltx_fake_quantize) mkdir -p scripts src/pacific for module in "${MODULES[@]}"; do cp "../scripts/$module.py" scripts/ done cp ../src/pacific/ltx_av.py ../src/pacific/strict_json.py src/pacific/ cat > src/pacific/__init__.py <<'PY' """A deliberately empty `pacific` for the Space. The real package's `__init__` re-exports the whole conversion toolchain, which would drag training, quantization and benchmarking imports into a Space that only needs two helpers. Importing `pacific.ltx_av` executes this file, so this file has to stay empty for that import to stay cheap. """ PY echo "synced ${#MODULES[@]} modules + pacific shim"