Skip to content

docs: rewrite README in Simplified Technical English #46

docs: rewrite README in Simplified Technical English

docs: rewrite README in Simplified Technical English #46

name: TTS Intelligibility
# Inline variant of OpenVoiceOS/gh-automations/.github/workflows/tts-intelligibility.yml@dev.
#
# Cotovia ships its own synthesis binary in the wheel, but get_tts also needs the
# Galician linguistic data and a voice under /usr/share/cotovia/data — these come
# from the cotovia .deb packages on SourceForge, which are NOT in the Ubuntu apt
# repos (so the reusable workflow's apt-based `system_deps` input cannot provide
# them). They are installed here so get_tts actually synthesises and the round-trip
# produces a real WER score instead of raising "No cotovia voices found".
#
# Triggers on `push` (not just pull_request) so the score is computed and posted
# even when GitHub does not emit a pull_request:synchronize event for a branch.
# The PR number is resolved from the branch via the API, so the score is posted to
# the open PR regardless of which event fired.
on:
push:
pull_request:
workflow_dispatch:
jobs:
tts-intelligibility:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
env:
MAX_WER: '0.5'
TEST_PATH: 'test/end2end/test_tts_intelligibility.py'
INSTALL_EXTRAS: 'test'
steps:
- uses: actions/checkout@v6
- name: Checkout gh-automations scripts
uses: actions/checkout@v6
with:
repository: OpenVoiceOS/gh-automations
ref: dev
path: _gh_automations/
- name: Setup Python 3.11
uses: actions/setup-python@v6
with:
python-version: '3.11'
- name: Install Cotovia (binary + Galician data + voice)
# The cotovia executable, Galician linguistic data and the "iago" voice are
# distributed as .deb packages on SourceForge (not in the Ubuntu repos). The
# voice/lang data lands in /usr/share/cotovia/data, which the plugin needs.
run: |
sudo apt-get update -q
base="https://sourceforge.net/projects/cotovia/files/Debian%20packages"
for pkg in cotovia_0.5_amd64.deb cotovia-lang-gl_0.5_all.deb cotovia-voice-iago_0.5_all.deb; do
curl -fsSL -o "/tmp/$pkg" "$base/$pkg/download"
done
sudo apt-get install -yq \
/tmp/cotovia_0.5_amd64.deb \
/tmp/cotovia-lang-gl_0.5_all.deb \
/tmp/cotovia-voice-iago_0.5_all.deb
ls /usr/share/cotovia/data
- name: Cache models (huggingface + plugin data)
uses: actions/cache@v4
with:
path: |
~/.cache/huggingface
~/.local/share
key: tts-intel-models-${{ runner.os }}-3.11-v1
restore-keys: |
tts-intel-models-${{ runner.os }}-3.11-
- name: Install Package with Test Extras
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-json-report
echo "Installing ovoscope[tts] from GitHub dev (pre_release)..."
pip install --force-reinstall \
"ovoscope[tts] @ git+https://github.com/TigreGotico/ovoscope@dev"
pip install ".[$INSTALL_EXTRAS]"
python -c "import ovoscope; print('ovoscope path:', ovoscope.__file__)"
- name: Run TTS intelligibility tests
id: run_tests
continue-on-error: true
env:
TTS_MAX_WER: ${{ env.MAX_WER }}
run: |
python -m pytest \
${{ env.TEST_PATH }} \
--json-report \
--json-report-file=/tmp/tts-intel-results.json \
-v -s 2>&1 | tee /tmp/tts-intel-stdout.txt
- name: Resolve open PR number for this commit
id: pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -n "${{ github.event.pull_request.number }}" ]; then
echo "number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
else
num=$(gh pr list --repo "${{ github.repository }}" \
--head "${{ github.ref_name }}" --state open \
--json number -q '.[0].number' 2>/dev/null || true)
echo "number=${num}" >> "$GITHUB_OUTPUT"
fi
- name: Format TTS intelligibility section for PR comment
if: ${{ steps.pr.outputs.number != '' }}
run: |
python3 _gh_automations/scripts/format_tts_intel.py \
--json /tmp/tts-intel-results.json \
--log /tmp/tts-intel-stdout.txt \
--max-wer "${{ env.MAX_WER }}" \
--out /tmp/tts-intel-section.md
- name: Post TTS intelligibility section to PR comment
if: ${{ steps.pr.outputs.number != '' }}
run: |
python3 _gh_automations/scripts/update_pr_comment.py \
--repo "${{ github.repository }}" \
--pr "${{ steps.pr.outputs.number }}" \
--section-id "tts-intelligibility" \
--title "🗣️ TTS Intelligibility" \
--content-file /tmp/tts-intel-section.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Galician (gl) is low-resource for the faster-whisper `tiny` reference STT,
# so report-only: the real score is posted, but a high round-trip WER does
# not fail the PR. (In practice synthesis works and WER lands near the gate.)
- name: Report-only notice if tests failed
if: ${{ steps.run_tests.outcome == 'failure' }}
run: |
echo "::warning::TTS intelligibility below threshold (mean WER > ${{ env.MAX_WER }}) — not failing (Galician is low-resource for the reference STT)."