Skip to content

Commit

Permalink
Remove old import from stream/web for ReadableStream (#752)
Browse files Browse the repository at this point in the history
Node 16 is no longer supported
  • Loading branch information
xenova committed May 20, 2024
1 parent bd31552 commit 0af1e2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
"path": false,
"url": false,
"sharp": false,
"onnxruntime-node": false,
"stream/web": false
"onnxruntime-node": false
},
"publishConfig": {
"access": "public"
Expand Down
6 changes: 0 additions & 6 deletions src/utils/hub.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@

import fs from 'fs';
import path from 'path';
import stream from 'stream/web';

import { env } from '../env.js';
import { dispatchCallback } from './core.js';

if (!globalThis.ReadableStream) {
// @ts-ignore
globalThis.ReadableStream = stream.ReadableStream; // ReadableStream is not a global with Node 16
}

/**
* @typedef {Object} PretrainedOptions Options for loading a pretrained model.
* @property {boolean?} [quantized=true] Whether to load the 8-bit quantized version of the model (only applicable when loading model files).
Expand Down

0 comments on commit 0af1e2f

Please sign in to comment.