File size: 2,762 Bytes
3e25ded
5f72bf5
3e25ded
 
306913a
 
3e25ded
306913a
3e25ded
 
 
 
 
 
 
 
 
 
 
306913a
3e25ded
306913a
3e25ded
 
 
306913a
3e25ded
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5f72bf5
3e25ded
 
 
 
 
 
 
306913a
 
 
3e25ded
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5f72bf5
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import gradio as gr
from blossomtune_gradio import config as cfg


# This component's value is updated dynamically by callbacks.
# We'll use a simple initial value here as the schema doesn't define an "authenticating" state.
auth_status_md = gr.Markdown("Authenticating...", render=False)

superlink_status_public_txt = gr.Textbox(
    "🔴 Not Running", label="Superlink Status", interactive=False, render=False
)
log_output = gr.Textbox(
    label="Logs (Superlink & Runner)",
    lines=20,
    autoscroll=True,
    interactive=False,
    show_copy_button=True,
    render=False,
)
# The button's text/variant is updated dynamically by callbacks.
superlink_toggle_btn = gr.Button("🚀 Start Superlink", variant="secondary")

hf_handle_tb = gr.Textbox(
    label="Your Hugging Face Handle",
    placeholder="Enter for local testing...",
    interactive=True,  # This is controlled by callbacks
    render=False,
)
email_tb = gr.Textbox(
    label="Your Contact E-mail",
    placeholder="e.g., user@example.com",
    render=False,
)
activation_code_tb = gr.Textbox(
    label="Activation Code",
    placeholder="Enter code from your email...",
    render=False,
)
admin_panel = gr.Column(visible=False)
superlink_status_admin_txt = gr.Textbox(
    "🔴 Not Running",
    label="Superlink Status",
    interactive=False,
    render=False,
)
runner_status_txt = gr.Textbox(
    "🔴 Not Running", label="Runner Status", interactive=False, render=False
)
runner_toggle_btn = gr.Button("▶️ Start Federated Run", variant="primary")
runner_app_dd = gr.Dropdown(
    cfg.FLOWER_APPS,
    label="Select Runner App",
    render=False,
)
run_id_tb = gr.Textbox(label="Run ID", placeholder="e.g., run_123")
num_partitions_tb = gr.Textbox(
    label="Total Partitions", value="10", placeholder="e.g., 10", render=False
)
# This component is populated by callbacks using the settings file.
request_status_md = gr.Markdown(render=False)

pending_requests_df = gr.DataFrame(
    headers=["Participant ID", "HF Handle", "Email"],
    label="Pending Requests (click a row to select)",
    row_count=(5, "dynamic"),
    interactive=False,
    render=False,
)
approved_participants_df = gr.DataFrame(
    headers=[
        "Participant ID",
        "HF Handle",
        "Email",
        "Partition ID",
    ],
    label="Approved Participants",
    interactive=False,
    row_count=(5, "dynamic"),
    render=False,
)
selected_participant_id_tb = gr.Textbox(
    label="Selected Participant ID",
    interactive=False,
    render=False,
)
partition_id_tb = gr.Textbox(
    label="Assign Partition ID",
    placeholder="Auto-filled on selection...",
    render=False,
)
ca_cert_download = gr.File(
    label="Download CA Certificate (ca.crt)", visible=False, render=False
)