@@ -63,6 +63,8 @@ bash "$SCRIPT" sensevoice "$TMP/out" >/dev/null
6363assert_log " download FunAudioLLM/SenseVoiceSmall-GGUF sensevoice-small-q8.gguf --local-dir $TMP /out"
6464assert_log " download FunAudioLLM/fsmn-vad-GGUF fsmn-vad.gguf --local-dir $TMP /out"
6565assert_no_log " --include *.gguf"
66+ DEFAULT_SENSEVOICE_MODEL=$( awk ' $1 == "download" && $2 == "FunAudioLLM/SenseVoiceSmall-GGUF" { print $3; exit }' " $HF_LOG " )
67+ [[ -n " $DEFAULT_SENSEVOICE_MODEL " ]]
6668
6769reset_case
6870bash " $SCRIPT " paraformer " $TMP /out" f16 > /dev/null
@@ -109,21 +111,49 @@ grep -F "no GGUF files found in $TMP/out" "$TMP/stderr" >/dev/null
109111
110112assert_readme_quickstart () {
111113 local readme=$1
112- if ! grep -F " bash download-funasr-model.sh sensevoice ./gguf" " $readme " > /dev/null; then
114+ local section_prefix=$2
115+ local section
116+ local quickstart
117+
118+ if ! section=$( awk -v prefix=" $section_prefix " '
119+ !found && index($0, prefix) == 1 { found = 1 }
120+ found && /^---$/ { exit }
121+ found { print }
122+ END { if (!found) exit 1 }
123+ ' " $readme " ) ; then
124+ printf ' missing CPU/edge section in %s\n' " $readme " >&2
125+ exit 1
126+ fi
127+
128+ if ! quickstart=$( printf ' %s\n' " $section " | awk '
129+ !seen && /^```bash$/ { seen = 1; in_block = 1; next }
130+ in_block && /^```$/ { complete = 1; exit }
131+ in_block { print }
132+ END { if (!seen || !complete) exit 1 }
133+ ' ) ; then
134+ printf ' missing Bash quickstart block in %s\n' " $readme " >&2
135+ exit 1
136+ fi
137+
138+ if ! grep -F " bash download-funasr-model.sh sensevoice ./gguf" <<< " $quickstart" > /dev/null; then
113139 printf ' missing default SenseVoice download command in %s\n' " $readme " >&2
114140 exit 1
115141 fi
116- if ! grep -F " llama-funasr-sensevoice -m ./gguf/sensevoice-small-q8.gguf --vad ./gguf/fsmn-vad.gguf -a audio.wav" " $readme " > /dev/null; then
142+ if ! grep -F " ./ llama-funasr-sensevoice -m ./gguf/$DEFAULT_SENSEVOICE_MODEL --vad ./gguf/fsmn-vad.gguf -a audio.wav" <<< " $quickstart " > /dev/null; then
117143 printf ' README command does not run the default sensevoice-small-q8.gguf in %s\n' " $readme " >&2
118144 exit 1
119145 fi
120- if grep -F " SenseVoiceSmall-f16.gguf" " $readme " > /dev/null; then
121- printf ' stale SenseVoice filename in %s\n' " $readme " >&2
146+ if ! grep -F " .\\ pkg\\ llama-funasr-sensevoice.exe -m .\\ gguf\\ $DEFAULT_SENSEVOICE_MODEL --vad .\\ gguf\\ fsmn-vad.gguf -a audio.wav" <<< " $section" > /dev/null; then
147+ printf ' missing Windows PowerShell quickstart in %s\n' " $readme " >&2
148+ exit 1
149+ fi
150+ if ! grep -F ' [Releases](https://github.com/modelscope/FunASR/releases)' <<< " $section" > /dev/null; then
151+ printf ' non-portable Releases link in %s\n' " $readme " >&2
122152 exit 1
123153 fi
124154}
125155
126- assert_readme_quickstart " $REPO_ROOT /README.md"
127- assert_readme_quickstart " $REPO_ROOT /README_zh.md"
156+ assert_readme_quickstart " $REPO_ROOT /README.md" ' ### CPU / Edge '
157+ assert_readme_quickstart " $REPO_ROOT /README_zh.md" ' ### CPU / 边缘部署 '
128158
129159echo " download-funasr-model contract tests passed"
0 commit comments