16 lines · 905 B · ShellRaw
#!/usr/bin/env bash# convert_indicconformer.sh <out-dir> <lang> [--check audio.wav]: one IndicConformer# language to sherpa-onnx, in its own venv (${VOICE_HOME:-~/.cache/cotton-voice}/venv-convert).# Needs HF_TOKEN (the AI4Bharat repos are gated) and uv or python3.10.set -euo pipefailHERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"VENV="${VOICE_HOME:-$HOME/.cache/cotton-voice}/venv-convert"if [ ! -x "$VENV/bin/python" ] || ! cmp -s "$HERE/requirements-convert.txt" "$VENV/.requirements.txt"; then if command -v uv >/dev/null; then uv venv -q -p 3.10 "$VENV" && VIRTUAL_ENV="$VENV" uv pip install -q -r "$HERE/requirements-convert.txt" else python3.10 -m venv "$VENV" && "$VENV/bin/python" -m pip install -q -r "$HERE/requirements-convert.txt" fi cp "$HERE/requirements-convert.txt" "$VENV/.requirements.txt"fiexec "$VENV/bin/python" "$HERE/convert_indicconformer.py" "$@"