Gradio JS Client raises error when use Private Space. (Python Client works.)
connect and view_api APIs work without any issue.
When call predict API, following error happens. (If make space public, no error.)
Any help would be appreciated.
Response {
status: 404,
statusText: 'Not Found',
headers: Headers {
date: 'Tue, 29 Oct 2024 01:06:13 GMT',
'content-type': 'text/html; charset=utf-8',
'content-length': '3020',
connection: 'keep-alive',
'x-request-id': 'Sb9C2M',
vary: 'origin, access-control-request-method, access-control-request-headers',
'access-control-allow-credentials': 'true'
},
body: ReadableStream { locked: false, state: 'readable', supportsBYOB: true },
bodyUsed: false,
ok: false,
redirected: false,
type: 'basic',
url: 'https://xxxxx.hf.space/queue/data?session_hash=k03zo4aqyv'
}
Unexpected error Connection errored out.
{
type: 'status',
stage: 'error',
message: 'Connection errored out. ',
queue: true,
endpoint: '/zzzz',
fn_index: 1,
time: 2024-10-29T01:06:13.435Z
}
Reproduce code
import { Client, handle_file } from "@gradio/client";
async function main() {
const response_0 = await fetch("https://raw.githubusercontent.com/gradio-app/gradio/main/test/test_files/bus.png");
const exampleImage = await response_0.blob();
const client = await Client.connect("User/SpaceName", {hf_token: "hf_xxxxx"});
const result = await client.predict("/zzzzzzz", {
path: exampleImage,
});
console.log(result);
}
main().catch(console.error)