Skip to content

fix: reject native CLI keywords that swallow the audio filename - #180

Merged
LauraGPT merged 1 commit into
QwenAudio:mainfrom
mvanhorn:fix/175-native-cli-keywords-input
Nov 20, 2026
Merged

LauraGPT merged 1 commit into
QwenAudio:mainfrom
mvanhorn:fix/175-native-cli-keywords-input

Conversation

@mvanhorn

Copy link
Copy Markdown
Contributor

Summary

Placing a local recording after --keywords can make the CLI download the default English sample and ignore the supplied recording. --keywords uses nargs="*", so argparse can consume both the keywords and the trailing filename. The resulting empty audio list triggers the sample download.

When the audio list is empty, the CLI rejects any keyword containing a path separator or ending in a recognized audio suffix, ignoring case for the suffix check. The usage error appears before any download and explains how to disambiguate the filename. Explicit audio files are now decoded before runtime validation. New tests cover rejection without a download, local file selection, and the pinned sample fallback.

Fixes #175

User impact

Who benefits from this change, and what Fun-ASR workflow improves?

Model and runtime impact

  • No model behavior changes.
  • Affects Fun-ASR-Nano or Fun-ASR-MLT-Nano inference.
  • Affects streaming, vLLM, WebSocket, or client examples.
  • Affects GGUF / llama.cpp runtime assets or docs.
  • Affects Hugging Face, ModelScope, or model-card routing.

Validation

  • I ran the relevant tests or commands:
  • I checked changed README/docs/model links.
  • I verified affected model, runtime, or example behavior with a small audio sample when applicable.

pytest -q tests/test_transformers_quickstart.py stopped during collection because NumPy was missing, so no tests ran. Ran python3 -m pytest -q tests/test_transformers_quickstart.py in a Linux container (python:3.12) for the Fun-ASR load_audio change; 27 tests passed. A run with the Fun-ASR load_audio change reverted gave no clear result, so no test is shown to catch this bug.

Screenshots, logs, or transcripts

No user-visible surface changes in this PR, so there is nothing to show.

Notes for reviewers

Nothing beyond what is described above.

When the audio list is empty, the CLI rejects any keyword containing a
path separator or ending in a recognized audio suffix, ignoring case for
the suffix check. The usage error appears before any download and
explains how to disambiguate the filename. Explicit audio files are now
decoded before runtime validation. New tests cover rejection without a
download, local file selection, and the pinned sample fallback.

Fixes QwenAudio#175
@LauraGPT
LauraGPT merged commit 5df2b86 into QwenAudio:main Nov 20, 2026
1 check passed
@mvanhorn

Copy link
Copy Markdown
Contributor Author

@LauraGPT thanks for taking this one. The CLI now stops with a usage error when the keywords flag swallows the audio filename, instead of quietly downloading the sample.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Native CLI can consume the local filename as a keyword and select the default sample

2 participants