You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a library that is designed for use in a browser (HuggingFace's Transformers.js). It uses the Web Fetch API, so I've been trying to monkey-patch in node-fetch stuff with no success so far, due to node-fetch's Response type being incompatible with that used in the Web Fetch API.
After a bunch of work on my end, the program finally fails due to the library trying to call the getReader function of the body property of the Response. This function is not defined.
Reproduction
Steps to reproduce the behavior:
In a project folder install the NPM packages @xenova/transformers and ts-node.
In that same folder, create a TypeScript file that sets global.fetch to node-fetch's fetch function and calls the "pipeline" function of "transformers."
run npx ts-node
Expected behavior
The code should run without issue.
Screenshots
Your Environment
software
version
node-fetch
node
16.14.2
npm
7.13.0
Operating System
Windows 11
ts-node
latest as of June 2023
The text was updated successfully, but these errors were encountered:
I have a library that is designed for use in a browser (HuggingFace's Transformers.js). It uses the Web Fetch API, so I've been trying to monkey-patch in node-fetch stuff with no success so far, due to node-fetch's Response type being incompatible with that used in the Web Fetch API.
After a bunch of work on my end, the program finally fails due to the library trying to call the getReader function of the body property of the Response. This function is not defined.
Reproduction
Steps to reproduce the behavior:
Expected behavior
The code should run without issue.
Screenshots
Your Environment
The text was updated successfully, but these errors were encountered: