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 non-Web/browser-based project that uses TypeScript with ts-node.
The "pipeline" function attempts to use the JavaScript Fetch API, which is not included with NodeJS, and the code therefore fails with an error: "fetch is not defined."
The "node-fetch" package doesn't seem to provide a compatible API.
The text was updated successfully, but these errors were encountered:
One workaround to this is to pre-download your model files and then set env.allowRemoteModels=false; and env.localModelPath = '/path/to/local/models/'; to avoid the call to fetch. See here for more information about setting environment variables.
One issue you may run into is that Response will not be defined. However, since the response will be of type FileResponse (and not Response), you can maybe find a workaround by just setting globalThis.Response={} (or something similar):
If this is indeed the case, it might be beneficial to adapt the code (that line specifically) to account for the case where fetch and/or Request is not defined (PRs welcome!)
I have a non-Web/browser-based project that uses TypeScript with ts-node.
The "pipeline" function attempts to use the JavaScript Fetch API, which is not included with NodeJS, and the code therefore fails with an error: "fetch is not defined."
The "node-fetch" package doesn't seem to provide a compatible API.
The text was updated successfully, but these errors were encountered: