Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tps not initialized with 0, skip_special_tokens not exists in TextStreamer options #1091

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nekomeowww
Copy link

Summary

I realized several issues when trying to replicate the Whisper WebGPU example in my development environment:

  • The event of update may contain undefined value for tps, and with the semantic of the code, tps is used to calculate the speed of outputting tokens, where it should be consistant as number since it works like metrics.
  • According to Transformers.js documentation, instead, skip_special_tokens should be PreTrainedTokenizer.decode(...)'s option.

Changes

  • Initialize tps with 0.
  • Move skip_special_tokens into decode_kwargs as one of the property.
  • Added // eslint-disable-next-line no-unused-vars comment to disable lint check for line const [tokenizer, processor, model] = await AutomaticSpeechRecognitionPipeline.getInstance(x => { or lint will fail.

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.

1 participant