Skip to content

Commit 98a5201

Browse files
authored
[v4] Fix various TypeScript errors (#1477)
1 parent 11a6bfc commit 98a5201

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/pipelines/text-to-audio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { AutoModel } from '../models.js';
1818

1919
/**
2020
* @typedef {Object} TextToAudioOutput
21-
* @property {Float32Array} audio The generated audio waveform.
21+
* @property {Float32Array|Float32Array[]} audio The generated audio waveform.
2222
* @property {number} sampling_rate The sampling rate of the generated audio waveform.
2323
*
2424
* @typedef {Object} TextToAudioPipelineOptions Parameters specific to text-to-audio pipelines.

src/utils/audio.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,6 @@ function encodeWAV(chunks, rate) {
774774
/* data chunk length */
775775
view.setUint32(40, totalLength * 4, true);
776776

777-
// @ts-expect-error TS2322
778777
return new Blob([buffer, ...chunks], { type: "audio/wav" });
779778
}
780779

webpack.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,14 @@ const NODE_EXTERNAL_MODULES = [
171171
"node:fs",
172172
"node:path",
173173
"node:url",
174+
"node:stream",
175+
"node:stream/promises",
174176
];
175177

176178
// Do not bundle node-only packages when bundling for the web.
177179
// NOTE: We can exclude the "node:" prefix for built-in modules here,
178180
// since we apply the `StripNodePrefixPlugin` to strip it.
179-
const WEB_IGNORE_MODULES = ["onnxruntime-node", "sharp", "fs", "path", "url"];
181+
const WEB_IGNORE_MODULES = ["onnxruntime-node", "sharp", "fs", "path", "url", "stream", "stream/promises"];
180182

181183
// Do not bundle the following modules with webpack (mark as external)
182184
const WEB_EXTERNAL_MODULES = ["onnxruntime-common", "onnxruntime-web"];

0 commit comments

Comments
 (0)