Closed jakiestfu closed 1 year ago
Thanks @jakiestfu for creating this issue, cc-ing @pngwn -- does this relate to the Gradio JS client you've been working on?
In some ways there is a little bit of overlap with #3404 which I can support as well with my pull request.
We don't want any PRs against the client just yet. Any changes would have no impact as the library is not released yet. We'll consider this use-case as we prepare for release.
Renaming the issue for clarity.
Thats unfortunate to hear, @pngwn but I understand. Is there a timeline for release of the client?
Very soon!
Hi @pngwn , I'm trying to use the @gradio/client in nodejs but getting the "fetch is not defined" error.
Is there any sample code available on how to install the @gradio/client package in nodejs?
As described here, all you should need to do is:
npm i @gradio/client
its js client and only works in browsers. I'm looking for the nodejs example. If we run the client on nodejs you get the below error:
ReferenceError: fetch is not defined
at file:///Users/logeshrajappa/work/music-gen-api/node_modules/@gradio/client/dist/index.js:731:70
Is there any gradio client working without browser? I need pure nodejs implementation too. thx.
@logesh2496 You need to update your node version to 18+. However there is another issue affecting the javascript gradio client in 4.0. This will be addressed shortly.
@pngwn any news on this issue? I'm getting errors when trying to run the client in Node.js (standard SvelteKit application, in a form action endpoint), I assume this is the issue you previously mentioned? ReferenceError: EventSource is not defined
I guess I can try a polyfill for EventSource, but I'm not sure I won't run into other issues later on.
Any development on this issue?
There is a PR open for this atm. Should be released soon!
Is your feature request related to a problem? Please describe.
I would like to be able to leverage the gradio client in my nodejs server to run inference on a private gradio api.
Describe the solution you'd like
Additional context
I've made these changes to the gradio client locally and it works like a charm. If ya'll are interested, I can pose a PR.