Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronous support #2

Closed
denizsincar29 opened this issue Aug 19, 2024 · 4 comments
Closed

Synchronous support #2

denizsincar29 opened this issue Aug 19, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@denizsincar29
Copy link

Hello. Is there a way to use gradio client synchronously? My whole app is synchronous so I don't want to rewrite it. Thank you.

@JacobLinCool
Copy link
Owner

JacobLinCool commented Aug 20, 2024

I could try adding a synchronous API.

Before the asynchronous API is done, you can try using block_on to run an asynchronous function in a synchronous context, I think.

@JacobLinCool JacobLinCool self-assigned this Aug 20, 2024
@JacobLinCool JacobLinCool added the enhancement New feature or request label Aug 20, 2024
@JacobLinCool
Copy link
Owner

Hi @denizsincar29,

The synchronization API is now available in 0.2.3, try using the *_sync functions. You can check out the "hello-sync" example to see usage.

@denizsincar29
Copy link
Author

Oh thank you so much. That's cool. Just wanted to ask if it also supports wasm?

@JacobLinCool
Copy link
Owner

JacobLinCool commented Aug 20, 2024

I think it's possible, but I may need to figure out the right feature flags for Tokio and Reqwest.

If you're interested in that, here are some references you may need:

However, Gradio already has an official JS client, so you may want to try it in your WASM environment if it also supports JS.

Move WASM support to a new issue: #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants