Spaces:
Running
Running
| import gradio as gr | |
| import os | |
| # CSS to change orange UI elements to blue | |
| blue_ui_css = """ | |
| /* Change orange checkboxes and radio buttons to blue */ | |
| .gradio-container input[type="checkbox"]:checked, | |
| .gradio-container .gr-checkbox input:checked + .checkmark, | |
| .gradio-container .gr-checkboxgroup input:checked + .checkmark { | |
| background-color: #667eea !important; | |
| border-color: #667eea !important; | |
| } | |
| .gradio-container input[type="radio"]:checked, | |
| .gradio-container .gr-radio input:checked + .checkmark, | |
| .gradio-container .gr-radio input:checked::before { | |
| background-color: #667eea !important; | |
| border-color: #667eea !important; | |
| } | |
| /* Override any orange accent colors */ | |
| .gradio-container .gr-checkbox input:checked, | |
| .gradio-container .gr-checkboxgroup input:checked, | |
| .gradio-container .gr-radio input:checked { | |
| accent-color: #667eea !important; | |
| } | |
| /* Target specific Gradio checkbox styling */ | |
| .gradio-container label input[type="checkbox"]:checked::before, | |
| .gradio-container label input[type="radio"]:checked::before { | |
| background-color: #667eea !important; | |
| } | |
| /* Comprehensive tab underline styling - blue instead of orange */ | |
| .gradio-container .tab-nav button[aria-selected="true"], | |
| .gradio-container .tab-nav button.selected, | |
| .gradio-container button[role="tab"][aria-selected="true"], | |
| .gradio-container button[role="tab"].selected, | |
| .gradio-container .tabs button[aria-selected="true"], | |
| .gradio-container .tabs button.selected, | |
| .gradio-container [data-testid="tab"] button[aria-selected="true"], | |
| .gradio-container .tab button[aria-selected="true"], | |
| .gradio-container [role="tablist"] button[aria-selected="true"] { | |
| color: #667eea !important; | |
| border-bottom: 2px solid #667eea !important; | |
| border-bottom-color: #667eea !important; | |
| } | |
| /* Override any orange underlines specifically */ | |
| .gradio-container button[role="tab"][aria-selected="true"], | |
| .gradio-container .tabs .tab-nav button[aria-selected="true"], | |
| .gradio-container .tab-nav .tab-item[aria-selected="true"], | |
| .gradio-container .gradio-tabs button[aria-selected="true"] { | |
| border-bottom: 2px solid #667eea !important; | |
| border-bottom-color: #667eea !important; | |
| } | |
| /* Force override orange tab indicators */ | |
| .gradio-container *[style*="border-bottom"][style*="orange"], | |
| .gradio-container *[style*="border-color"][style*="orange"] { | |
| border-bottom-color: #667eea !important; | |
| } | |
| """ | |
| SPACE_REPO_ID = "IneqMath/ineqmath_evaluation_platform_private" | |
| hf_token = os.environ.get("HF_TOKEN") | |
| if not hf_token: | |
| try: | |
| import getpass | |
| hf_token = getpass.getpass("Enter your Hugging Face token (input hidden): ") | |
| except Exception: | |
| hf_token = input("Enter your Hugging Face token: ") | |
| if not hf_token: | |
| print("[ERROR] Hugging Face token is required. Set HF_TOKEN env variable or enter it when prompted.") | |
| exit(1) | |
| remote_space = None | |
| load_error = None | |
| try: | |
| remote_space = gr.load(f"spaces/{SPACE_REPO_ID}", hf_token=hf_token) | |
| except Exception as e: | |
| load_error = str(e) | |
| print(f"[ERROR] Failed to load remote Space: {load_error}") | |
| with gr.Blocks(css=blue_ui_css) as demo: | |
| if remote_space is not None: | |
| remote_space.render() | |
| else: | |
| gr.Markdown(f"**Failed to load remote Space.**\n\nError: {load_error}") | |
| if __name__ == "__main__": | |
| demo.launch() |