Update ui_components.py
Browse files- ui_components.py +7 -9
ui_components.py
CHANGED
|
@@ -106,15 +106,13 @@ class UIComponents:
|
|
| 106 |
def _create_login_section(self):
|
| 107 |
"""Create HuggingFace OAuth login section"""
|
| 108 |
with gr.Group(elem_classes="login-section"):
|
| 109 |
-
#
|
| 110 |
-
#
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
self.login_button = gr.LoginButton(**login_kwargs)
|
| 118 |
|
| 119 |
def _create_provider_model_selection(self):
|
| 120 |
"""Create provider and model selection dropdowns with defaults"""
|
|
|
|
| 106 |
def _create_login_section(self):
|
| 107 |
"""Create HuggingFace OAuth login section"""
|
| 108 |
with gr.Group(elem_classes="login-section"):
|
| 109 |
+
# Let Gradio determine the correct redirect URL when running on Hugging Face Spaces.
|
| 110 |
+
# Overriding redirect_url can easily cause a host/scheme mismatch (e.g., double https:// or wrong domain),
|
| 111 |
+
# which results in: "Error 400: Invalid redirect_uri, must start with https://<space>.hf.space".
|
| 112 |
+
#
|
| 113 |
+
# On Spaces, Gradio auto-configures OAuth to the Space subdomain, so we intentionally do NOT pass redirect_url.
|
| 114 |
+
# If running locally, OAuth via HF won't work; use HF_TOKEN instead.
|
| 115 |
+
self.login_button = gr.LoginButton(value="Sign in for Inference")
|
|
|
|
|
|
|
| 116 |
|
| 117 |
def _create_provider_model_selection(self):
|
| 118 |
"""Create provider and model selection dropdowns with defaults"""
|