Spaces:
Sleeping
Sleeping
Update CrossTalk AI to vertical clean layout
Browse files
app.py
CHANGED
|
@@ -259,6 +259,7 @@ def safe_search(query):
|
|
| 259 |
|
| 260 |
|
| 261 |
|
|
|
|
| 262 |
custom_css = """
|
| 263 |
.gradio-container {
|
| 264 |
background: #0B0F19 !important;
|
|
@@ -332,6 +333,7 @@ custom_css = """
|
|
| 332 |
border-radius: 18px !important;
|
| 333 |
padding: 22px !important;
|
| 334 |
box-shadow: 0 16px 38px rgba(0,0,0,0.22);
|
|
|
|
| 335 |
}
|
| 336 |
|
| 337 |
.search-card {
|
|
@@ -344,16 +346,16 @@ custom_css = """
|
|
| 344 |
|
| 345 |
.section-title {
|
| 346 |
color: #F8FAFC;
|
| 347 |
-
font-size:
|
| 348 |
font-weight: 800;
|
| 349 |
-
margin-bottom:
|
| 350 |
}
|
| 351 |
|
| 352 |
.section-subtitle {
|
| 353 |
color: #94A3B8;
|
| 354 |
-
font-size:
|
| 355 |
-
line-height: 1.
|
| 356 |
-
margin-bottom:
|
| 357 |
}
|
| 358 |
|
| 359 |
textarea, input {
|
|
@@ -375,7 +377,7 @@ button.search-button {
|
|
| 375 |
border-radius: 12px !important;
|
| 376 |
color: #FFFFFF !important;
|
| 377 |
font-weight: 800 !important;
|
| 378 |
-
min-height:
|
| 379 |
}
|
| 380 |
|
| 381 |
button.search-button:hover {
|
|
@@ -388,7 +390,7 @@ button.clear-button {
|
|
| 388 |
border-radius: 12px !important;
|
| 389 |
color: #E5E7EB !important;
|
| 390 |
font-weight: 750 !important;
|
| 391 |
-
min-height:
|
| 392 |
}
|
| 393 |
|
| 394 |
.status-panel textarea {
|
|
@@ -423,7 +425,12 @@ button.clear-button {
|
|
| 423 |
}
|
| 424 |
|
| 425 |
#examples-block {
|
| 426 |
-
margin-top:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
}
|
| 428 |
|
| 429 |
@media (max-width: 900px) {
|
|
@@ -480,73 +487,75 @@ with gr.Blocks(
|
|
| 480 |
"""
|
| 481 |
)
|
| 482 |
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
]
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
|
|
|
|
|
|
| 550 |
|
| 551 |
gr.HTML(
|
| 552 |
"""
|
|
|
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
+
|
| 263 |
custom_css = """
|
| 264 |
.gradio-container {
|
| 265 |
background: #0B0F19 !important;
|
|
|
|
| 333 |
border-radius: 18px !important;
|
| 334 |
padding: 22px !important;
|
| 335 |
box-shadow: 0 16px 38px rgba(0,0,0,0.22);
|
| 336 |
+
margin-bottom: 18px !important;
|
| 337 |
}
|
| 338 |
|
| 339 |
.search-card {
|
|
|
|
| 346 |
|
| 347 |
.section-title {
|
| 348 |
color: #F8FAFC;
|
| 349 |
+
font-size: 22px;
|
| 350 |
font-weight: 800;
|
| 351 |
+
margin-bottom: 6px;
|
| 352 |
}
|
| 353 |
|
| 354 |
.section-subtitle {
|
| 355 |
color: #94A3B8;
|
| 356 |
+
font-size: 14px;
|
| 357 |
+
line-height: 1.55;
|
| 358 |
+
margin-bottom: 18px;
|
| 359 |
}
|
| 360 |
|
| 361 |
textarea, input {
|
|
|
|
| 377 |
border-radius: 12px !important;
|
| 378 |
color: #FFFFFF !important;
|
| 379 |
font-weight: 800 !important;
|
| 380 |
+
min-height: 48px !important;
|
| 381 |
}
|
| 382 |
|
| 383 |
button.search-button:hover {
|
|
|
|
| 390 |
border-radius: 12px !important;
|
| 391 |
color: #E5E7EB !important;
|
| 392 |
font-weight: 750 !important;
|
| 393 |
+
min-height: 48px !important;
|
| 394 |
}
|
| 395 |
|
| 396 |
.status-panel textarea {
|
|
|
|
| 425 |
}
|
| 426 |
|
| 427 |
#examples-block {
|
| 428 |
+
margin-top: 14px;
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
.input-wide {
|
| 432 |
+
margin-top: 8px;
|
| 433 |
+
margin-bottom: 14px;
|
| 434 |
}
|
| 435 |
|
| 436 |
@media (max-width: 900px) {
|
|
|
|
| 487 |
"""
|
| 488 |
)
|
| 489 |
|
| 490 |
+
# SEARCH SECTION - FULL WIDTH
|
| 491 |
+
with gr.Column(elem_classes=["main-card", "search-card"]):
|
| 492 |
+
gr.HTML(
|
| 493 |
+
"""
|
| 494 |
+
<div class="section-title">Search input</div>
|
| 495 |
+
<div class="section-subtitle">
|
| 496 |
+
Enter an ethnic source word. Exact and base-form matches are treated as verified dictionary outputs.
|
| 497 |
+
</div>
|
| 498 |
+
"""
|
| 499 |
+
)
|
| 500 |
+
|
| 501 |
+
query = gr.Textbox(
|
| 502 |
+
label="Source word",
|
| 503 |
+
placeholder="Example: kəkhyáŋ, Hula, Aina, aam, bajaoo",
|
| 504 |
+
lines=1,
|
| 505 |
+
elem_classes=["input-wide"]
|
| 506 |
+
)
|
| 507 |
+
|
| 508 |
+
with gr.Row():
|
| 509 |
+
clear_btn = gr.Button("Clear", elem_classes=["clear-button"])
|
| 510 |
+
submit_btn = gr.Button("Search", elem_classes=["search-button"])
|
| 511 |
+
|
| 512 |
+
gr.Examples(
|
| 513 |
+
examples=[
|
| 514 |
+
["kəkhyáŋ"],
|
| 515 |
+
["Hula"],
|
| 516 |
+
["Aina"],
|
| 517 |
+
["aam"],
|
| 518 |
+
["bajaoo"],
|
| 519 |
+
["unknown tribal word"]
|
| 520 |
+
],
|
| 521 |
+
inputs=query,
|
| 522 |
+
label="Examples",
|
| 523 |
+
elem_id="examples-block"
|
| 524 |
+
)
|
| 525 |
+
|
| 526 |
+
# OUTPUT SECTION - BELOW SEARCH
|
| 527 |
+
with gr.Column(elem_classes=["main-card", "output-card"]):
|
| 528 |
+
gr.HTML(
|
| 529 |
+
"""
|
| 530 |
+
<div class="section-title">Retrieval output</div>
|
| 531 |
+
<div class="section-subtitle">
|
| 532 |
+
The system returns verified dictionary matches first. Semantic fallback appears only when no verified match is found.
|
| 533 |
+
</div>
|
| 534 |
+
"""
|
| 535 |
+
)
|
| 536 |
+
|
| 537 |
+
status = gr.Textbox(
|
| 538 |
+
label="System status",
|
| 539 |
+
lines=1,
|
| 540 |
+
elem_classes=["status-panel"],
|
| 541 |
+
value="Ready."
|
| 542 |
+
)
|
| 543 |
+
|
| 544 |
+
summary = gr.Markdown(
|
| 545 |
+
value="""
|
| 546 |
+
<div class="result-note">
|
| 547 |
+
Enter a source word and click Search. Results will appear below.
|
| 548 |
+
</div>
|
| 549 |
+
"""
|
| 550 |
+
)
|
| 551 |
+
|
| 552 |
+
results = gr.Dataframe(
|
| 553 |
+
label="Results table",
|
| 554 |
+
value=EMPTY_RESULTS,
|
| 555 |
+
interactive=False,
|
| 556 |
+
wrap=True,
|
| 557 |
+
max_height=460
|
| 558 |
+
)
|
| 559 |
|
| 560 |
gr.HTML(
|
| 561 |
"""
|