Skip to content

Commit

Permalink
Update types
Browse files Browse the repository at this point in the history
  • Loading branch information
xenova committed Dec 28, 2024
1 parent 158c707 commit ea5b789
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/models/pyannote/feature_extraction_pyannote.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class PyAnnoteFeatureExtractor extends FeatureExtractor {

let current_speaker = -1;
for (let i = 0; i < scores.length; ++i) {
/** @type {number[]} */
const probabilities = softmax(scores[i]);
const [score, id] = max(probabilities);
const [start, end] = [i, i + 1];
Expand Down
2 changes: 1 addition & 1 deletion src/models/whisper/feature_extraction_whisper.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class WhisperFeatureExtractor extends FeatureExtractor {
)

const data = features.data;
const maxValue = max(data)[0];
const maxValue = max(/** @type {Float32Array} */(data))[0];

for (let i = 0; i < data.length; ++i) {
data[i] = (Math.max(data[i], maxValue - 8.0) + 4.0) / 4.0;
Expand Down

0 comments on commit ea5b789

Please sign in to comment.