Simplify Transformers usage snippet

#2
by eustlb HF Staff - opened
  • apply_transcription_request loads paths and URLs itself, so librosa is no longer needed.
  • processor.decode(..., return_format="transcription_only") strips the language <Name><asr_text> prefix, which batch_decode prints whenever language is omitted.
  • device_map="auto" instead of .to("cuda"); generate already runs without gradients, so inference_mode is dropped.

Tested with transformers main: same transcription with language="English" and with auto-detection.

MarktHart changed pull request status to merged
MarktHart deleted the refs/pr/2 ref

Sign up or log in to comment