"Use via API" return HTTP 403

#13
by iCSawyer - opened

I use the bottom button "Use via API" and write programs like this:

from gradio_client import Client

token = "xxx"

client = Client("https://bigcode-in-the-stack.hf.space/--replicas/k4gs2/", hf_token=token)
result = client.predict(
        "xxx",	# str  in 'Your GitHub username:' Textbox component
        "v2.0-rc,v2.0-rc",	# str (Option from: [('v2.0-rc', 'v2.0-rc'), ('v1.2', 'v1.2'), ('v1.1', 'v1.1'), ('v1.0', 'v1.0')]) in 'The Stack version:' Dropdown component
        fn_index=0,
)
print(result)

However, it returns InvalidStatusCode: server rejected WebSocket connection: HTTP 403. I was wondering the reason. Thank you for your help~

Sign up or log in to comment