How can I get the space REST API builded from gradio Block?
when the space was builded from gradio Interface, there is a view api option on the buttom of page,  like this spaceGradio Predict API Docs.but when some space builded from gradio Block, there isn’t the view api option.please help me how to solve this issue.thanks.
2022-09-09T17:36:50Z
hi@zzzzzznot all Gradio apps have the API enabled, so there is not an easy way to use it. You could use the internal queue endpoint, but it’s not straightforward.
2022-09-14T22:43:33Z
Hi@zzzzzzjust wanted to add that the “view API” page will show up if you add theapi_nameparameter when you define the events in your gradio Blocks.We’re working on making that easier to understand here:Show view api button even if there are no named api routes in the app by freddyaboulton · Pull Request #2250 · gradio-app/gradio · GitHub
2022-09-15T12:48:37Z
wow, nice worklook forword it.
2022-09-15T15:06:05Z
@zzzzzz, as an alternative to the REST API, you can load an app via theloadclass method ongradio.Blocksand then treat it like a regular python function.This behaves the same as the REST API but abstracts away the logic of writing the request yourself.There’s a guide on that here:Using Blocks Like Functions