Install the whole backend from one script; queue log; UI fixes
install_comfyui.sh becomes install_backend.sh and now builds everything the app needs, not just the speech half: - Step 7 runs normalizer/setup.sh --model, which fetches both models: the open inflection model first, so the install gets as far as it can before anything can ask for credentials, then the gated fine-tune. - A missing Hugging Face account is no longer fatal. Accepting a licence is the one thing an installer cannot do, so the rest installs, the verification reports "fallback only (gated model missing)", and the summary prints the three commands that finish it. - --skip-normalizer, disk requirement 35 -> 55 GB, removal instructions and the step list updated to match. Queue logging — queue.log in the first queued video's job folder, which for a single-video run is its own: - Records what went wrong rather than what happened: warnings, tracebacks, ffmpeg errors, guard rejections, clips cut off mid-word or that crashed the backend, and the --regen line carrying their numbers. - ComfyUI failures *and* restarts, so the log shows the recovery rather than reading as though the run simply stopped. GUI-initiated backend actions go in too; they never pass through a job's pipe. - A failure also dumps the job's last 15 lines. Keyword matching alone is not enough — ffmpeg says "Invalid data found when processing input" and nothing that looks like an error. UI: - The output pane follows new output only while already at the bottom. Scroll up and it stays there; scroll back down and it resumes. Reading an earlier warning during a run was impossible while every ffmpeg progress frame yanked the view to the end. - The ComfyUI button's status dot is drawn as its own canvas item, so it can be green (answering) or amber (holds the port, does not answer). A "." inside the label could only ever be the same grey as the words. comfyui.log is capped at 120,000 lines, trimmed on backend start and every five minutes. Rewritten in place, never replaced: tee holds it open in append mode, so swapping the inode would leave the backend writing to an unlinked file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+31
-11
@@ -2,7 +2,7 @@
|
||||
# Create the isolated environment for the Polish number normalizer.
|
||||
#
|
||||
# ./setup.sh venv + dependencies
|
||||
# ./setup.sh --model also download the model (needs HF_TOKEN)
|
||||
# ./setup.sh --model also download both models (see below)
|
||||
# ./setup.sh --cpu CPU-only torch, for a machine without an NVIDIA GPU
|
||||
#
|
||||
# Kept separate from the ComfyUI environment on purpose: this needs
|
||||
@@ -13,7 +13,9 @@ set -euo pipefail
|
||||
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
VENV="$HERE/venv"
|
||||
MODEL_DIR="$HERE/model"
|
||||
MODEL_REPO="Folx/qwen3-0.6b-pl-text-normalization"
|
||||
MODEL_REPO="Folx/qwen3-0.6b-pl-text-normalization" # gated: times, dates, IDs
|
||||
LLM_REPO="CYFRAGOVPL/PLLuM-4B-instruct-2512" # open: grammar of plain integers
|
||||
LLM_DIR="$HERE/models/PLLuM-4B-instruct-2512"
|
||||
TORCH_INDEX="https://download.pytorch.org/whl/cu128" # same wheels as ComfyUI
|
||||
|
||||
WANT_MODEL=0
|
||||
@@ -44,25 +46,43 @@ say "Installing transformers, accelerate, num2words"
|
||||
"$VENV/bin/pip" install "transformers>=5.0.0" "accelerate>=0.26.0" "num2words>=0.5.13"
|
||||
|
||||
if [ "$WANT_MODEL" = 1 ]; then
|
||||
say "Downloading $MODEL_REPO"
|
||||
"$VENV/bin/pip" install --quiet "huggingface_hub[cli]"
|
||||
|
||||
# The inflection model first: it needs no account, so the install gets as
|
||||
# far as it can before anything can ask for credentials.
|
||||
if [ -f "$LLM_DIR/config.json" ]; then
|
||||
say "$LLM_REPO already present"
|
||||
else
|
||||
say "Downloading $LLM_REPO (8 GB, no account needed)"
|
||||
"$VENV/bin/hf" download "$LLM_REPO" --local-dir "$LLM_DIR"
|
||||
fi
|
||||
|
||||
say "Downloading $MODEL_REPO"
|
||||
|
||||
# Either an HF_TOKEN in the environment or a stored `hf auth login` works;
|
||||
# the CLI picks up both on its own. Only say something when there is
|
||||
# neither, because the failure then is a confusing "access denied".
|
||||
if [ -z "${HF_TOKEN:-}" ] && ! "$VENV/bin/hf" auth whoami >/dev/null 2>&1; then
|
||||
if [ -f "$MODEL_DIR/config.json" ]; then
|
||||
say "$MODEL_REPO already present"
|
||||
elif [ -z "${HF_TOKEN:-}" ] && ! "$VENV/bin/hf" auth whoami >/dev/null 2>&1; then
|
||||
# Not fatal. Everything else is installed and useful; this one model
|
||||
# needs a human to accept a licence, which no installer can do.
|
||||
cat >&2 <<EOF
|
||||
No Hugging Face credentials. The repo is gated (approval is automatic, but it
|
||||
has to be your account that asks):
|
||||
|
||||
1. Open https://huggingface.co/$MODEL_REPO while signed in and accept the terms
|
||||
2. Either $VENV/bin/hf auth login
|
||||
or HF_TOKEN=hf_... $0 --model
|
||||
[!] Skipped $MODEL_REPO — no Hugging Face credentials.
|
||||
It is gated (approval is automatic, but your account has to ask):
|
||||
|
||||
1. Open https://huggingface.co/$MODEL_REPO while signed in, accept terms
|
||||
2. Either $VENV/bin/hf auth login
|
||||
or export HF_TOKEN=hf_...
|
||||
3. Rerun $0 --model
|
||||
|
||||
Until then times, dates and identifiers fall back to num2words.
|
||||
|
||||
EOF
|
||||
exit 1
|
||||
else
|
||||
"$VENV/bin/hf" download "$MODEL_REPO" --local-dir "$MODEL_DIR"
|
||||
fi
|
||||
"$VENV/bin/hf" download "$MODEL_REPO" --local-dir "$MODEL_DIR"
|
||||
fi
|
||||
|
||||
say "Checking the installation"
|
||||
|
||||
Reference in New Issue
Block a user