Skip to content

Commit

Permalink
erge remote-tracking branch 'origin/main' into dependabot/github_acti…
Browse files Browse the repository at this point in the history
…ons/dot-github/workflows/tj-actions/changed-files-41
  • Loading branch information
j0rd1smit committed Jun 7, 2024
2 parents 10084b0 + 9abe575 commit 0c092e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
run: hugo --minify

- name: Deploy
if: github.event_name != 'pull_request'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions assets/js/modelFactories.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ function createModelLoader(model_name) {
const load_model = async ({ progress_callback = undefined }) => {
if (model === null) {
model = await pipeline("automatic-speech-recognition", model_name, {
quantized: true,
progress_callback,
});
}
Expand Down
13 changes: 8 additions & 5 deletions assets/js/whisper.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ async function transcribe(audio, model_name) {
});
sendLoadingMessage("success");

const stride_length_s = 5;
const isDistilWhisper = model_name.includes("distil-whisper");
const stride_length_s = isDistilWhisper ? 3 : 5;
const generationTracker = new GenerationTracker(pipeline, stride_length_s);

await pipeline(audio, {
top_k: 0, // TODO: make this configurable via request
do_sample: false, // TODO: make this configurable via request
chunk_length_s: 30, // TODO: make this configurable via request
stride_length_s: stride_length_s, // TODO: make this configurable via request
top_k: 0,
do_sample: false,
chunk_length_s: isDistilWhisper ? 20 : 30,
stride_length_s: stride_length_s,
return_timestamps: true,
force_full_sequences: false,
callback_function:
generationTracker.callbackFunction.bind(generationTracker),
chunk_callback: generationTracker.chunkCallback.bind(generationTracker),
Expand Down

0 comments on commit 0c092e0

Please sign in to comment.