Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,6 +39,139 @@ DUMMY_DATASET = [
|
|
| 39 |
}
|
| 40 |
]
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
class AnnotationManager:
|
| 43 |
def __init__(self):
|
| 44 |
self.annotations = {} # Store annotations by user_id
|
|
@@ -122,7 +255,7 @@ def login(user_id: str) -> Tuple:
|
|
| 122 |
gr.update(visible=True), # login_interface
|
| 123 |
gr.update(visible=False), # annotation_interface
|
| 124 |
"", # user_state
|
| 125 |
-
gr.update(value="Please enter a valid ID"), # login_status
|
| 126 |
gr.update(), # prompt
|
| 127 |
gr.update(), # response_a
|
| 128 |
gr.update(), # response_b
|
|
@@ -137,7 +270,7 @@ def login(user_id: str) -> Tuple:
|
|
| 137 |
gr.update(visible=True), # login_interface
|
| 138 |
gr.update(visible=False), # annotation_interface
|
| 139 |
user_id, # user_state
|
| 140 |
-
gr.update(value=f"All samples completed for user: {user_id}"), # login_status
|
| 141 |
gr.update(), # prompt
|
| 142 |
gr.update(), # response_a
|
| 143 |
gr.update(), # response_b
|
|
@@ -148,11 +281,11 @@ def login(user_id: str) -> Tuple:
|
|
| 148 |
gr.update(visible=False), # login_interface
|
| 149 |
gr.update(visible=True), # annotation_interface
|
| 150 |
user_id, # user_state
|
| 151 |
-
gr.update(value=""), # login_status
|
| 152 |
gr.update(value=sample["prompt"]), # prompt
|
| 153 |
gr.update(value=sample["response_a"]), # response_a
|
| 154 |
gr.update(value=sample["response_b"]), # response_b
|
| 155 |
-
gr.update(value=f"Progress: {current}/{total}") # progress
|
| 156 |
)
|
| 157 |
|
| 158 |
def annotate(choice: str, user_id: str) -> Tuple:
|
|
@@ -163,7 +296,7 @@ def annotate(choice: str, user_id: str) -> Tuple:
|
|
| 163 |
gr.update(), # response_a
|
| 164 |
gr.update(), # response_b
|
| 165 |
gr.update(), # progress
|
| 166 |
-
gr.update(value="Error: No user logged in", visible=True) # status
|
| 167 |
)
|
| 168 |
|
| 169 |
# Get current sample to save annotation
|
|
@@ -182,19 +315,19 @@ def annotate(choice: str, user_id: str) -> Tuple:
|
|
| 182 |
|
| 183 |
if next_sample is None:
|
| 184 |
return (
|
| 185 |
-
gr.update(value="All samples completed! Thank you for your annotations."), # prompt
|
| 186 |
gr.update(value=""), # response_a
|
| 187 |
gr.update(value=""), # response_b
|
| 188 |
-
gr.update(value=f"Progress: {total}/{total} - Complete!"), # progress
|
| 189 |
-
gr.update(value="All annotations complete!", visible=True) # status
|
| 190 |
)
|
| 191 |
|
| 192 |
return (
|
| 193 |
gr.update(value=next_sample["prompt"]), # prompt
|
| 194 |
gr.update(value=next_sample["response_a"]), # response_a
|
| 195 |
gr.update(value=next_sample["response_b"]), # response_b
|
| 196 |
-
gr.update(value=f"Progress: {current}/{total}"), # progress
|
| 197 |
-
gr.update(value="Annotation saved!", visible=True) # status
|
| 198 |
)
|
| 199 |
|
| 200 |
def logout() -> Tuple:
|
|
@@ -203,72 +336,118 @@ def logout() -> Tuple:
|
|
| 203 |
gr.update(visible=True), # login_interface
|
| 204 |
gr.update(visible=False), # annotation_interface
|
| 205 |
"", # user_state
|
| 206 |
-
gr.update(value=""), # login_status
|
| 207 |
gr.update(value=""), # prompt
|
| 208 |
gr.update(value=""), # response_a
|
| 209 |
gr.update(value=""), # response_b
|
| 210 |
-
gr.update(value="") # progress
|
| 211 |
)
|
| 212 |
|
| 213 |
# Create Gradio interface
|
| 214 |
-
with gr.Blocks(title="Dataset Annotation Tool") as app:
|
| 215 |
-
gr.Markdown("#
|
| 216 |
-
gr.Markdown("
|
| 217 |
|
| 218 |
user_state = gr.State("")
|
| 219 |
|
| 220 |
# Login Interface
|
| 221 |
-
with gr.Group(visible=True) as login_interface:
|
| 222 |
-
gr.Markdown("## Login")
|
| 223 |
-
gr.Markdown("Enter your annotator ID to begin. Your ID determines the order of samples you'll see.")
|
| 224 |
|
| 225 |
with gr.Row():
|
| 226 |
user_id_input = gr.Textbox(
|
| 227 |
label="Annotator ID",
|
| 228 |
-
placeholder="
|
| 229 |
-
scale=3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 230 |
)
|
| 231 |
-
login_btn = gr.Button("Login", variant="primary", scale=1)
|
| 232 |
|
| 233 |
-
login_status = gr.Markdown("")
|
| 234 |
|
| 235 |
# Annotation Interface
|
| 236 |
-
with gr.Group(visible=False) as annotation_interface:
|
| 237 |
-
|
|
|
|
| 238 |
|
| 239 |
# Row 1: Prompt
|
|
|
|
| 240 |
with gr.Row():
|
| 241 |
prompt_display = gr.Textbox(
|
| 242 |
-
label="
|
| 243 |
interactive=False,
|
| 244 |
-
lines=3
|
|
|
|
|
|
|
| 245 |
)
|
| 246 |
|
|
|
|
|
|
|
| 247 |
# Row 2: Responses
|
|
|
|
| 248 |
with gr.Row():
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
|
| 262 |
-
|
|
|
|
|
|
|
|
|
|
| 263 |
with gr.Row():
|
| 264 |
-
btn_a = gr.Button(
|
| 265 |
-
|
| 266 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 267 |
|
| 268 |
-
|
|
|
|
| 269 |
|
|
|
|
| 270 |
with gr.Row():
|
| 271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
# Event handlers
|
| 274 |
login_btn.click(
|
|
@@ -311,6 +490,10 @@ with gr.Blocks(title="Dataset Annotation Tool") as app:
|
|
| 311 |
progress_label,
|
| 312 |
status_message
|
| 313 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 314 |
)
|
| 315 |
|
| 316 |
btn_b.click(
|
|
@@ -323,6 +506,10 @@ with gr.Blocks(title="Dataset Annotation Tool") as app:
|
|
| 323 |
progress_label,
|
| 324 |
status_message
|
| 325 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 326 |
)
|
| 327 |
|
| 328 |
btn_equal.click(
|
|
@@ -335,6 +522,10 @@ with gr.Blocks(title="Dataset Annotation Tool") as app:
|
|
| 335 |
progress_label,
|
| 336 |
status_message
|
| 337 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
| 338 |
)
|
| 339 |
|
| 340 |
logout_btn.click(
|
|
|
|
| 39 |
}
|
| 40 |
]
|
| 41 |
|
| 42 |
+
# Custom CSS for better styling
|
| 43 |
+
custom_css = """
|
| 44 |
+
.gradio-container {
|
| 45 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
.login-container {
|
| 49 |
+
max-width: 500px;
|
| 50 |
+
margin: auto;
|
| 51 |
+
padding: 2rem;
|
| 52 |
+
}
|
| 53 |
+
|
| 54 |
+
.annotation-container {
|
| 55 |
+
max-width: 1200px;
|
| 56 |
+
margin: auto;
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/* Header styling */
|
| 60 |
+
h1 {
|
| 61 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 62 |
+
-webkit-background-clip: text;
|
| 63 |
+
-webkit-text-fill-color: transparent;
|
| 64 |
+
background-clip: text;
|
| 65 |
+
text-align: center;
|
| 66 |
+
font-size: 2.5rem !important;
|
| 67 |
+
margin-bottom: 0.5rem !important;
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
h2 {
|
| 71 |
+
color: #4a5568;
|
| 72 |
+
text-align: center;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
/* Card-like appearance for groups */
|
| 76 |
+
.gr-group {
|
| 77 |
+
background: white;
|
| 78 |
+
border-radius: 12px;
|
| 79 |
+
padding: 1.5rem;
|
| 80 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 81 |
+
border: 1px solid #e2e8f0;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
/* Prompt box styling */
|
| 85 |
+
.prompt-box textarea {
|
| 86 |
+
background: linear-gradient(135deg, #f5f7fa 0%, #f0f4f8 100%);
|
| 87 |
+
border: 2px solid #e2e8f0;
|
| 88 |
+
border-radius: 8px;
|
| 89 |
+
font-size: 1.1rem;
|
| 90 |
+
line-height: 1.6;
|
| 91 |
+
padding: 1rem;
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
/* Response boxes styling */
|
| 95 |
+
.response-box textarea {
|
| 96 |
+
background: #ffffff;
|
| 97 |
+
border: 2px solid #e2e8f0;
|
| 98 |
+
border-radius: 8px;
|
| 99 |
+
font-size: 1rem;
|
| 100 |
+
line-height: 1.5;
|
| 101 |
+
transition: all 0.3s ease;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.response-box:hover textarea {
|
| 105 |
+
border-color: #cbd5e0;
|
| 106 |
+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
/* Button styling */
|
| 110 |
+
.annotation-button {
|
| 111 |
+
font-weight: 600;
|
| 112 |
+
padding: 0.75rem 1.5rem;
|
| 113 |
+
border-radius: 8px;
|
| 114 |
+
transition: all 0.3s ease;
|
| 115 |
+
text-transform: uppercase;
|
| 116 |
+
letter-spacing: 0.025em;
|
| 117 |
+
font-size: 0.9rem;
|
| 118 |
+
}
|
| 119 |
+
|
| 120 |
+
/* Progress bar styling */
|
| 121 |
+
.progress-container {
|
| 122 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 123 |
+
color: white;
|
| 124 |
+
padding: 0.75rem 1.25rem;
|
| 125 |
+
border-radius: 8px;
|
| 126 |
+
font-weight: 600;
|
| 127 |
+
text-align: center;
|
| 128 |
+
margin-bottom: 1rem;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/* Status message styling */
|
| 132 |
+
.status-message {
|
| 133 |
+
background: #10b981;
|
| 134 |
+
color: white;
|
| 135 |
+
padding: 0.5rem 1rem;
|
| 136 |
+
border-radius: 6px;
|
| 137 |
+
text-align: center;
|
| 138 |
+
animation: slideIn 0.3s ease;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
@keyframes slideIn {
|
| 142 |
+
from {
|
| 143 |
+
opacity: 0;
|
| 144 |
+
transform: translateY(-10px);
|
| 145 |
+
}
|
| 146 |
+
to {
|
| 147 |
+
opacity: 1;
|
| 148 |
+
transform: translateY(0);
|
| 149 |
+
}
|
| 150 |
+
}
|
| 151 |
+
|
| 152 |
+
/* Login form styling */
|
| 153 |
+
.login-input input {
|
| 154 |
+
font-size: 1.1rem;
|
| 155 |
+
padding: 0.75rem;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
/* Divider styling */
|
| 159 |
+
.divider {
|
| 160 |
+
height: 1px;
|
| 161 |
+
background: linear-gradient(to right, transparent, #e2e8f0, transparent);
|
| 162 |
+
margin: 1.5rem 0;
|
| 163 |
+
}
|
| 164 |
+
|
| 165 |
+
/* Label improvements */
|
| 166 |
+
label {
|
| 167 |
+
font-weight: 600;
|
| 168 |
+
color: #4a5568;
|
| 169 |
+
font-size: 0.875rem;
|
| 170 |
+
text-transform: uppercase;
|
| 171 |
+
letter-spacing: 0.025em;
|
| 172 |
+
}
|
| 173 |
+
"""
|
| 174 |
+
|
| 175 |
class AnnotationManager:
|
| 176 |
def __init__(self):
|
| 177 |
self.annotations = {} # Store annotations by user_id
|
|
|
|
| 255 |
gr.update(visible=True), # login_interface
|
| 256 |
gr.update(visible=False), # annotation_interface
|
| 257 |
"", # user_state
|
| 258 |
+
gr.update(value="β οΈ Please enter a valid ID", visible=True), # login_status
|
| 259 |
gr.update(), # prompt
|
| 260 |
gr.update(), # response_a
|
| 261 |
gr.update(), # response_b
|
|
|
|
| 270 |
gr.update(visible=True), # login_interface
|
| 271 |
gr.update(visible=False), # annotation_interface
|
| 272 |
user_id, # user_state
|
| 273 |
+
gr.update(value=f"β
All samples completed for user: {user_id}", visible=True), # login_status
|
| 274 |
gr.update(), # prompt
|
| 275 |
gr.update(), # response_a
|
| 276 |
gr.update(), # response_b
|
|
|
|
| 281 |
gr.update(visible=False), # login_interface
|
| 282 |
gr.update(visible=True), # annotation_interface
|
| 283 |
user_id, # user_state
|
| 284 |
+
gr.update(value="", visible=False), # login_status
|
| 285 |
gr.update(value=sample["prompt"]), # prompt
|
| 286 |
gr.update(value=sample["response_a"]), # response_a
|
| 287 |
gr.update(value=sample["response_b"]), # response_b
|
| 288 |
+
gr.update(value=f"π Progress: {current}/{total} samples", visible=True) # progress
|
| 289 |
)
|
| 290 |
|
| 291 |
def annotate(choice: str, user_id: str) -> Tuple:
|
|
|
|
| 296 |
gr.update(), # response_a
|
| 297 |
gr.update(), # response_b
|
| 298 |
gr.update(), # progress
|
| 299 |
+
gr.update(value="β Error: No user logged in", visible=True) # status
|
| 300 |
)
|
| 301 |
|
| 302 |
# Get current sample to save annotation
|
|
|
|
| 315 |
|
| 316 |
if next_sample is None:
|
| 317 |
return (
|
| 318 |
+
gr.update(value="π All samples completed! Thank you for your annotations."), # prompt
|
| 319 |
gr.update(value=""), # response_a
|
| 320 |
gr.update(value=""), # response_b
|
| 321 |
+
gr.update(value=f"β
Progress: {total}/{total} - Complete!", visible=True), # progress
|
| 322 |
+
gr.update(value="π All annotations complete! You can now logout.", visible=True) # status
|
| 323 |
)
|
| 324 |
|
| 325 |
return (
|
| 326 |
gr.update(value=next_sample["prompt"]), # prompt
|
| 327 |
gr.update(value=next_sample["response_a"]), # response_a
|
| 328 |
gr.update(value=next_sample["response_b"]), # response_b
|
| 329 |
+
gr.update(value=f"π Progress: {current}/{total} samples", visible=True), # progress
|
| 330 |
+
gr.update(value="β
Annotation saved!", visible=True) # status
|
| 331 |
)
|
| 332 |
|
| 333 |
def logout() -> Tuple:
|
|
|
|
| 336 |
gr.update(visible=True), # login_interface
|
| 337 |
gr.update(visible=False), # annotation_interface
|
| 338 |
"", # user_state
|
| 339 |
+
gr.update(value="", visible=False), # login_status
|
| 340 |
gr.update(value=""), # prompt
|
| 341 |
gr.update(value=""), # response_a
|
| 342 |
gr.update(value=""), # response_b
|
| 343 |
+
gr.update(value="", visible=False) # progress
|
| 344 |
)
|
| 345 |
|
| 346 |
# Create Gradio interface
|
| 347 |
+
with gr.Blocks(title="Dataset Annotation Tool", theme=gr.themes.Soft(), css=custom_css) as app:
|
| 348 |
+
gr.Markdown("# π― Fluency Annotation Tool")
|
| 349 |
+
gr.Markdown("Compare and annotate response fluency for AI-generated text")
|
| 350 |
|
| 351 |
user_state = gr.State("")
|
| 352 |
|
| 353 |
# Login Interface
|
| 354 |
+
with gr.Group(visible=True, elem_classes="login-container") as login_interface:
|
| 355 |
+
gr.Markdown("## π€ Annotator Login")
|
| 356 |
+
gr.Markdown("Enter your unique annotator ID to begin. Your ID determines the order of samples you'll see and tracks your progress.")
|
| 357 |
|
| 358 |
with gr.Row():
|
| 359 |
user_id_input = gr.Textbox(
|
| 360 |
label="Annotator ID",
|
| 361 |
+
placeholder="e.g., annotator_001",
|
| 362 |
+
scale=3,
|
| 363 |
+
elem_classes="login-input"
|
| 364 |
+
)
|
| 365 |
+
login_btn = gr.Button(
|
| 366 |
+
"π Start Annotating",
|
| 367 |
+
variant="primary",
|
| 368 |
+
scale=1,
|
| 369 |
+
size="lg"
|
| 370 |
)
|
|
|
|
| 371 |
|
| 372 |
+
login_status = gr.Markdown("", visible=False)
|
| 373 |
|
| 374 |
# Annotation Interface
|
| 375 |
+
with gr.Group(visible=False, elem_classes="annotation-container") as annotation_interface:
|
| 376 |
+
# Progress bar
|
| 377 |
+
progress_label = gr.Markdown("", elem_classes="progress-container", visible=False)
|
| 378 |
|
| 379 |
# Row 1: Prompt
|
| 380 |
+
gr.Markdown("### π Prompt")
|
| 381 |
with gr.Row():
|
| 382 |
prompt_display = gr.Textbox(
|
| 383 |
+
label="",
|
| 384 |
interactive=False,
|
| 385 |
+
lines=3,
|
| 386 |
+
elem_classes="prompt-box",
|
| 387 |
+
show_label=False
|
| 388 |
)
|
| 389 |
|
| 390 |
+
gr.HTML('<div class="divider"></div>')
|
| 391 |
+
|
| 392 |
# Row 2: Responses
|
| 393 |
+
gr.Markdown("### π¬ Responses")
|
| 394 |
with gr.Row():
|
| 395 |
+
with gr.Column(scale=1):
|
| 396 |
+
gr.Markdown("**Response A**")
|
| 397 |
+
response_a_display = gr.Textbox(
|
| 398 |
+
label="",
|
| 399 |
+
interactive=False,
|
| 400 |
+
lines=6,
|
| 401 |
+
elem_classes="response-box",
|
| 402 |
+
show_label=False
|
| 403 |
+
)
|
| 404 |
+
|
| 405 |
+
with gr.Column(scale=1):
|
| 406 |
+
gr.Markdown("**Response B**")
|
| 407 |
+
response_b_display = gr.Textbox(
|
| 408 |
+
label="",
|
| 409 |
+
interactive=False,
|
| 410 |
+
lines=6,
|
| 411 |
+
elem_classes="response-box",
|
| 412 |
+
show_label=False
|
| 413 |
+
)
|
| 414 |
|
| 415 |
+
gr.HTML('<div class="divider"></div>')
|
| 416 |
+
|
| 417 |
+
# Row 3: Annotation Buttons
|
| 418 |
+
gr.Markdown("### π― Which response is more fluent?")
|
| 419 |
with gr.Row():
|
| 420 |
+
btn_a = gr.Button(
|
| 421 |
+
"β¨ A is more fluent",
|
| 422 |
+
variant="primary",
|
| 423 |
+
elem_classes="annotation-button",
|
| 424 |
+
size="lg"
|
| 425 |
+
)
|
| 426 |
+
btn_equal = gr.Button(
|
| 427 |
+
"βοΈ Equally fluent",
|
| 428 |
+
variant="secondary",
|
| 429 |
+
elem_classes="annotation-button",
|
| 430 |
+
size="lg"
|
| 431 |
+
)
|
| 432 |
+
btn_b = gr.Button(
|
| 433 |
+
"β¨ B is more fluent",
|
| 434 |
+
variant="primary",
|
| 435 |
+
elem_classes="annotation-button",
|
| 436 |
+
size="lg"
|
| 437 |
+
)
|
| 438 |
|
| 439 |
+
# Status message
|
| 440 |
+
status_message = gr.Markdown("", visible=False, elem_classes="status-message")
|
| 441 |
|
| 442 |
+
# Logout button
|
| 443 |
with gr.Row():
|
| 444 |
+
gr.Column(scale=3)
|
| 445 |
+
logout_btn = gr.Button(
|
| 446 |
+
"πͺ Logout",
|
| 447 |
+
variant="stop",
|
| 448 |
+
size="sm",
|
| 449 |
+
scale=1
|
| 450 |
+
)
|
| 451 |
|
| 452 |
# Event handlers
|
| 453 |
login_btn.click(
|
|
|
|
| 490 |
progress_label,
|
| 491 |
status_message
|
| 492 |
]
|
| 493 |
+
).then(
|
| 494 |
+
lambda: gr.update(visible=False),
|
| 495 |
+
outputs=[status_message],
|
| 496 |
+
_js="() => setTimeout(() => true, 2000)"
|
| 497 |
)
|
| 498 |
|
| 499 |
btn_b.click(
|
|
|
|
| 506 |
progress_label,
|
| 507 |
status_message
|
| 508 |
]
|
| 509 |
+
).then(
|
| 510 |
+
lambda: gr.update(visible=False),
|
| 511 |
+
outputs=[status_message],
|
| 512 |
+
_js="() => setTimeout(() => true, 2000)"
|
| 513 |
)
|
| 514 |
|
| 515 |
btn_equal.click(
|
|
|
|
| 522 |
progress_label,
|
| 523 |
status_message
|
| 524 |
]
|
| 525 |
+
).then(
|
| 526 |
+
lambda: gr.update(visible=False),
|
| 527 |
+
outputs=[status_message],
|
| 528 |
+
_js="() => setTimeout(() => true, 2000)"
|
| 529 |
)
|
| 530 |
|
| 531 |
logout_btn.click(
|