API Endpoint Access?

#483
by insolentbastard - opened

I've duplicated pharma/CLIP-Interrogator, and am running it as a private space. But how do i enable API access?

If I scroll down to the bottom the page, there's a "Use via API Button", which leads here.
"No named API Routes found for https://pharma-clip-interrogator.hf.space/
To expose an API endpoint of your app in this page, set the api_name parameter of the event listener.
For more information, visit the API Page guide. To hide the API documentation button and this page, set show_api=False in the Blocks.launch() method."

If I follow the doc
Adding the btn.click causes the error below, and I have set set show_api=True

bcplc 2023-03-25T23:08:49.146Z Traceback (most recent call last):
bcplc 2023-03-25T23:08:49.146Z File "app.py", line 214, in
bcplc 2023-03-25T23:08:49.146Z btn.click(add, [num1, num2], output, api_name="addition")
bcplc 2023-03-25T23:08:49.146Z NameError: name 'btn' is not defined
bcplc 2023-03-25T23:08:58.262Z Loading BLIP model...

Sign up or log in to comment