mirror of
https://github.com/gradio-app/gradio.git
synced 2024-11-27 01:40:20 +08:00
fix: zero gpu auth ignoring hf_token (#8323)
This commit is contained in:
parent
81cc4007bc
commit
4d78f29666
@ -496,8 +496,12 @@ export function submit(
|
||||
const origin = hostname.includes(".dev.")
|
||||
? `https://moon-${hostname.split(".")[1]}.${hfhubdev}`
|
||||
: `https://huggingface.co`;
|
||||
|
||||
const is_iframe =
|
||||
typeof window !== "undefined" && window.parent != window;
|
||||
const is_zerogpu_space = dependency.zerogpu && config.space_id;
|
||||
const zerogpu_auth_promise =
|
||||
dependency.zerogpu && window.parent != window && config.space_id
|
||||
is_iframe && is_zerogpu_space
|
||||
? post_message<Headers>("zerogpu-headers", origin)
|
||||
: Promise.resolve(null);
|
||||
const post_data_promise = zerogpu_auth_promise.then((headers) => {
|
||||
|
Loading…
Reference in New Issue
Block a user