Upload folder using huggingface_hub
Browse files
6.5.0/client/src/helpers/init_helpers.ts
CHANGED
|
@@ -104,7 +104,6 @@ export async function resolve_config(
|
|
| 104 |
current_page: window.gradio_config.current_page
|
| 105 |
};
|
| 106 |
}
|
| 107 |
-
window.gradio_config.root = endpoint;
|
| 108 |
// @ts-ignore
|
| 109 |
return { ...window.gradio_config } as Config;
|
| 110 |
} else if (endpoint) {
|
|
@@ -119,7 +118,11 @@ export async function resolve_config(
|
|
| 119 |
});
|
| 120 |
|
| 121 |
const config = await handleConfigResponse(response, !!this.options.auth);
|
| 122 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
return config;
|
| 124 |
}
|
| 125 |
|
|
|
|
| 104 |
current_page: window.gradio_config.current_page
|
| 105 |
};
|
| 106 |
}
|
|
|
|
| 107 |
// @ts-ignore
|
| 108 |
return { ...window.gradio_config } as Config;
|
| 109 |
} else if (endpoint) {
|
|
|
|
| 118 |
});
|
| 119 |
|
| 120 |
const config = await handleConfigResponse(response, !!this.options.auth);
|
| 121 |
+
// Preserve the backend-provided root if available (it contains the correct public URL)
|
| 122 |
+
// Only fall back to endpoint if the backend didn't provide a root
|
| 123 |
+
if (!config.root) {
|
| 124 |
+
config.root = endpoint;
|
| 125 |
+
}
|
| 126 |
return config;
|
| 127 |
}
|
| 128 |
|