Nischal Subedi
commited on
Commit
·
c9550de
1
Parent(s):
ed5c80c
UI v9
Browse files
app.py
CHANGED
@@ -314,8 +314,8 @@ Answer:"""
|
|
314 |
position: relative;
|
315 |
overflow: hidden;
|
316 |
z-index: 10;
|
317 |
-
margin-bottom:
|
318 |
-
border:
|
319 |
border-top: none;
|
320 |
max-width: 1120px;
|
321 |
margin-left: auto;
|
@@ -323,7 +323,7 @@ Answer:"""
|
|
323 |
width: 100%;
|
324 |
/* Enhanced background */
|
325 |
background-image: linear-gradient(135deg, var(--background-fill-primary) 0%, var(--background-fill-secondary) 100%);
|
326 |
-
box-shadow: 0
|
327 |
}
|
328 |
.app-header { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
|
329 |
.app-header-logo {
|
@@ -350,17 +350,17 @@ Answer:"""
|
|
350 |
/* Main dashboard container */
|
351 |
.main-dashboard-container {
|
352 |
border-radius: 24px;
|
353 |
-
border:
|
354 |
padding: 3.5rem !important;
|
355 |
-
margin: 0 auto 0.
|
356 |
z-index: 1; position: relative;
|
357 |
-
display: flex; flex-direction: column; gap:
|
358 |
max-width: 1120px;
|
359 |
}
|
360 |
/* Card sections within the dashboard */
|
361 |
.dashboard-card-section {
|
362 |
border-radius: 12px;
|
363 |
-
border: 2px solid var(--border-color-primary); /*
|
364 |
padding: 2.5rem;
|
365 |
box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
366 |
display: flex; flex-direction: column; gap: 1.5rem;
|
@@ -372,9 +372,9 @@ Answer:"""
|
|
372 |
/* Section titles */
|
373 |
.sub-section-title {
|
374 |
font-family: 'Playfair Display', serif !important;
|
375 |
-
font-size: 3.
|
376 |
font-weight: 800 !important;
|
377 |
-
text-align: center !important;
|
378 |
margin-top: 1.5rem !important;
|
379 |
margin-bottom: 0.8rem !important;
|
380 |
display: block !important;
|
@@ -413,7 +413,7 @@ Answer:"""
|
|
413 |
}
|
414 |
.gr-button-secondary { /* Override for secondary button specific look */
|
415 |
background: transparent !important;
|
416 |
-
border: 2px solid var(--neutral-
|
417 |
box-shadow: none !important;
|
418 |
}
|
419 |
.gr-button-secondary:hover:not(:disabled) {
|
@@ -455,7 +455,7 @@ Answer:"""
|
|
455 |
/* Examples table styling */
|
456 |
.examples-section table.gr-samples-table {
|
457 |
border-radius: 12px !important;
|
458 |
-
border: 2px solid var(--border-color-primary) !important; /*
|
459 |
overflow: hidden;
|
460 |
box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
461 |
}
|
@@ -475,7 +475,7 @@ Answer:"""
|
|
475 |
.examples-section table.gr-samples-table tr:first-child td { border-top: none !important; }
|
476 |
/* Footer styling */
|
477 |
.app-footer-wrapper {
|
478 |
-
border-top:
|
479 |
margin-top: 0.5rem;
|
480 |
padding-top: 2.5rem;
|
481 |
padding-bottom: 2.5rem;
|
@@ -499,10 +499,20 @@ Answer:"""
|
|
499 |
}
|
500 |
.app-footer p {
|
501 |
font-size: 1.05rem !important;
|
502 |
-
text-align: left !important;
|
503 |
margin-bottom: 1rem;
|
504 |
}
|
505 |
-
.app-footer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
/* Hide default Gradio example labels and related elements for cleaner presentation */
|
507 |
.gr-examples .gr-label, .gr-examples button.gr-button-filter, .gr-examples .label-wrap,
|
508 |
.gr-examples div[data-testid*="label-text"], .gr-examples span[data-testid*="label-text"],
|
@@ -522,10 +532,10 @@ Answer:"""
|
|
522 |
@media (max-width: 1024px) {
|
523 |
.gradio-container > .flex.flex-col { max-width: 960px; padding: 0 1.5rem !important; }
|
524 |
.app-header-title { font-size: 3.8rem; } .app-header-tagline { font-size: 1.5rem; }
|
525 |
-
.app-header-wrapper { padding: 2.5rem 3.5rem !important; margin-bottom: 1.
|
526 |
-
.main-dashboard-container { padding: 2.5rem !important; margin-bottom: 0.
|
527 |
.dashboard-card-section { padding: 1.8rem; border-radius: 8px; }
|
528 |
-
.sub-section-title { font-size: 2.
|
529 |
.input-row { gap: 1.5rem; } .input-field { min-width: 280px; }
|
530 |
.gradio-textbox textarea { min-height: 160px; } .output-card .response-header { font-size: 1.7rem; }
|
531 |
.examples-section { padding-top: 1.2rem; }
|
@@ -535,12 +545,12 @@ Answer:"""
|
|
535 |
}
|
536 |
@media (max-width: 768px) {
|
537 |
.gradio-container > .flex.flex-col { padding: 0 1rem !important; }
|
538 |
-
.app-header-wrapper { padding: 1.8rem 2.5rem !important; margin-bottom:
|
539 |
.app-header-logo { font-size: 4.5rem; margin-bottom: 0.6rem; } .app-header-title { font-size: 3.2rem; letter-spacing: -0.06em; }
|
540 |
.app-header-tagline { font-size: 1.3rem; }
|
541 |
-
.main-dashboard-container { padding: 1.8rem !important; margin-bottom: 0.
|
542 |
.dashboard-card-section { padding: 1.5rem; border-radius: 8px; }
|
543 |
-
.sub-section-title { font-size: 2.
|
544 |
.input-row { flex-direction: column; gap: 1rem; } .input-field { min-width: 100%; }
|
545 |
.gradio-textbox textarea { min-height: 140px; } .button-row { justify-content: stretch; gap: 1rem; }
|
546 |
.gradio-button { width: 100%; padding: 1.1rem 2rem !important; font-size: 1.1rem !important; }
|
@@ -553,12 +563,12 @@ Answer:"""
|
|
553 |
}
|
554 |
@media (max-width: 480px) {
|
555 |
.gradio-container > .flex.flex-col { padding: 0 0.8rem !important; }
|
556 |
-
.app-header-wrapper { padding: 1.2rem 1rem !important; margin-bottom:
|
557 |
.app-header-logo { font-size: 3.8rem; margin-bottom: 0.5rem; } .app-header-title { font-size: 2.8rem; }
|
558 |
.app-header-tagline { font-size: 1.1rem; }
|
559 |
-
.main-dashboard-container { padding: 1.2rem !important; margin-bottom: 0.
|
560 |
.dashboard-card-section { padding: 1rem; border-radius: 4px; }
|
561 |
-
.sub-section-title { font-size:
|
562 |
.gradio-textbox textarea, .gradio-dropdown select, .gradio-textbox input[type=password] { font-size: 1.05rem !important; padding: 1rem 1.2rem !important; }
|
563 |
.gradio-textbox textarea { min-height: 120px; }
|
564 |
.gradio-button { padding: 1rem 1.5rem !important; font-size: 1.0rem !important; }
|
@@ -695,8 +705,6 @@ if __name__ == "__main__":
|
|
695 |
print(f"\n--- CONFIGURATION ERROR ---\nPDF file ('{os.path.basename(PDF_PATH)}') not found at: {PDF_PATH}.\nPlease ensure it exists or set 'PDF_PATH' environment variable.\n---------------------------\n")
|
696 |
exit(1) # This exit is correct: if file not found
|
697 |
|
698 |
-
# This `if` block checks for readability *only if the file exists*.
|
699 |
-
# The erroneous `exit(1)` that was likely at line 701 has been removed.
|
700 |
if not os.access(PDF_PATH, os.R_OK):
|
701 |
logging.error(f"FATAL: PDF file at '{PDF_PATH}' exists but is not readable. Check file permissions.")
|
702 |
print(f"\n--- PERMISSION ERROR ---\nPDF file ('{os.path.basename(PDF_PATH)}') found but not readable at: {PDF_PATH}\nPlease check file permissions (e.g., using 'chmod +r' in terminal).\n---------------------------\n")
|
|
|
314 |
position: relative;
|
315 |
overflow: hidden;
|
316 |
z-index: 10;
|
317 |
+
margin-bottom: 1.5rem; /* Reduced margin */
|
318 |
+
border: 3px solid var(--border-color-primary) !important; /* Thicker border */
|
319 |
border-top: none;
|
320 |
max-width: 1120px;
|
321 |
margin-left: auto;
|
|
|
323 |
width: 100%;
|
324 |
/* Enhanced background */
|
325 |
background-image: linear-gradient(135deg, var(--background-fill-primary) 0%, var(--background-fill-secondary) 100%);
|
326 |
+
box-shadow: 0 12px 35px rgba(0,0,0,0.5); /* More pronounced shadow */
|
327 |
}
|
328 |
.app-header { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; }
|
329 |
.app-header-logo {
|
|
|
350 |
/* Main dashboard container */
|
351 |
.main-dashboard-container {
|
352 |
border-radius: 24px;
|
353 |
+
border: 3px solid var(--border-color-primary) !important; /* Thicker border */
|
354 |
padding: 3.5rem !important;
|
355 |
+
margin: 0 auto 0.4rem auto; /* Further reduced margin-bottom */
|
356 |
z-index: 1; position: relative;
|
357 |
+
display: flex; flex-direction: column; gap: 1.5rem; /* Further reduced gap between boxes */
|
358 |
max-width: 1120px;
|
359 |
}
|
360 |
/* Card sections within the dashboard */
|
361 |
.dashboard-card-section {
|
362 |
border-radius: 12px;
|
363 |
+
border: 2px solid var(--border-color-primary); /* Keeping at 2px for inner cards, fits better */
|
364 |
padding: 2.5rem;
|
365 |
box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
366 |
display: flex; flex-direction: column; gap: 1.5rem;
|
|
|
372 |
/* Section titles */
|
373 |
.sub-section-title {
|
374 |
font-family: 'Playfair Display', serif !important;
|
375 |
+
font-size: 3.2rem !important; /* Increased font size */
|
376 |
font-weight: 800 !important;
|
377 |
+
text-align: center !important;
|
378 |
margin-top: 1.5rem !important;
|
379 |
margin-bottom: 0.8rem !important;
|
380 |
display: block !important;
|
|
|
413 |
}
|
414 |
.gr-button-secondary { /* Override for secondary button specific look */
|
415 |
background: transparent !important;
|
416 |
+
border: 2px solid var(--neutral-700) !important; /* Made border darker for contrast */
|
417 |
box-shadow: none !important;
|
418 |
}
|
419 |
.gr-button-secondary:hover:not(:disabled) {
|
|
|
455 |
/* Examples table styling */
|
456 |
.examples-section table.gr-samples-table {
|
457 |
border-radius: 12px !important;
|
458 |
+
border: 2px solid var(--border-color-primary) !important; /* Keeps border at 2px for consistency with other cards */
|
459 |
overflow: hidden;
|
460 |
box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
|
461 |
}
|
|
|
475 |
.examples-section table.gr-samples-table tr:first-child td { border-top: none !important; }
|
476 |
/* Footer styling */
|
477 |
.app-footer-wrapper {
|
478 |
+
border-top: 3px solid var(--border-color-primary) !important; /* Thicker border */
|
479 |
margin-top: 0.5rem;
|
480 |
padding-top: 2.5rem;
|
481 |
padding-bottom: 2.5rem;
|
|
|
499 |
}
|
500 |
.app-footer p {
|
501 |
font-size: 1.05rem !important;
|
502 |
+
text-align: left !important; /* Explicitly left-aligned */
|
503 |
margin-bottom: 1rem;
|
504 |
}
|
505 |
+
.app-footer strong {
|
506 |
+
color: var(--text-color-body) !important; /* Ensure bold text is clearly visible */
|
507 |
+
}
|
508 |
+
.app-footer a {
|
509 |
+
font-weight: 500;
|
510 |
+
color: var(--primary-500) !important; /* Ensure links are themed and clear */
|
511 |
+
text-decoration: underline; /* Added underline for clarity */
|
512 |
+
}
|
513 |
+
.app-footer a:hover {
|
514 |
+
text-decoration: none; /* Remove underline on hover */
|
515 |
+
}
|
516 |
/* Hide default Gradio example labels and related elements for cleaner presentation */
|
517 |
.gr-examples .gr-label, .gr-examples button.gr-button-filter, .gr-examples .label-wrap,
|
518 |
.gr-examples div[data-testid*="label-text"], .gr-examples span[data-testid*="label-text"],
|
|
|
532 |
@media (max-width: 1024px) {
|
533 |
.gradio-container > .flex.flex-col { max-width: 960px; padding: 0 1.5rem !important; }
|
534 |
.app-header-title { font-size: 3.8rem; } .app-header-tagline { font-size: 1.5rem; }
|
535 |
+
.app-header-wrapper { padding: 2.5rem 3.5rem !important; margin-bottom: 1.2rem; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } /* Adjusted margin */
|
536 |
+
.main-dashboard-container { padding: 2.5rem !important; margin-bottom: 0.3rem; border-radius: 12px; gap: 1.2rem; } /* Adjusted gap */
|
537 |
.dashboard-card-section { padding: 1.8rem; border-radius: 8px; }
|
538 |
+
.sub-section-title { font-size: 2.8rem !important; margin-bottom: 0.7rem !important; } /* Adjusted font size */
|
539 |
.input-row { gap: 1.5rem; } .input-field { min-width: 280px; }
|
540 |
.gradio-textbox textarea { min-height: 160px; } .output-card .response-header { font-size: 1.7rem; }
|
541 |
.examples-section { padding-top: 1.2rem; }
|
|
|
545 |
}
|
546 |
@media (max-width: 768px) {
|
547 |
.gradio-container > .flex.flex-col { padding: 0 1rem !important; }
|
548 |
+
.app-header-wrapper { padding: 1.8rem 2.5rem !important; margin-bottom: 1rem; border-bottom-left-radius: 12px; border-bottom-right-radius: 12px; } /* Adjusted margin */
|
549 |
.app-header-logo { font-size: 4.5rem; margin-bottom: 0.6rem; } .app-header-title { font-size: 3.2rem; letter-spacing: -0.06em; }
|
550 |
.app-header-tagline { font-size: 1.3rem; }
|
551 |
+
.main-dashboard-container { padding: 1.8rem !important; margin-bottom: 0.2rem; border-radius: 12px; gap: 1rem; } /* Adjusted gap */
|
552 |
.dashboard-card-section { padding: 1.5rem; border-radius: 8px; }
|
553 |
+
.sub-section-title { font-size: 2.3rem !important; margin-top: 1rem !important; margin-bottom: 0.6rem !important; } /* Adjusted font size */
|
554 |
.input-row { flex-direction: column; gap: 1rem; } .input-field { min-width: 100%; }
|
555 |
.gradio-textbox textarea { min-height: 140px; } .button-row { justify-content: stretch; gap: 1rem; }
|
556 |
.gradio-button { width: 100%; padding: 1.1rem 2rem !important; font-size: 1.1rem !important; }
|
|
|
563 |
}
|
564 |
@media (max-width: 480px) {
|
565 |
.gradio-container > .flex.flex-col { padding: 0 0.8rem !important; }
|
566 |
+
.app-header-wrapper { padding: 1.2rem 1rem !important; margin-bottom: 0.8rem; border-bottom-left-radius: 8px; border-bottom-right-radius: 8px; } /* Adjusted margin */
|
567 |
.app-header-logo { font-size: 3.8rem; margin-bottom: 0.5rem; } .app-header-title { font-size: 2.8rem; }
|
568 |
.app-header-tagline { font-size: 1.1rem; }
|
569 |
+
.main-dashboard-container { padding: 1.2rem !important; margin-bottom: 0.2rem; border-radius: 8px; gap: 0.8rem; } /* Adjusted gap */
|
570 |
.dashboard-card-section { padding: 1rem; border-radius: 4px; }
|
571 |
+
.sub-section-title { font-size: 2.0rem !important; margin-top: 0.8rem !important; margin-bottom: 0.5rem !important; } /* Adjusted font size */
|
572 |
.gradio-textbox textarea, .gradio-dropdown select, .gradio-textbox input[type=password] { font-size: 1.05rem !important; padding: 1rem 1.2rem !important; }
|
573 |
.gradio-textbox textarea { min-height: 120px; }
|
574 |
.gradio-button { padding: 1rem 1.5rem !important; font-size: 1.0rem !important; }
|
|
|
705 |
print(f"\n--- CONFIGURATION ERROR ---\nPDF file ('{os.path.basename(PDF_PATH)}') not found at: {PDF_PATH}.\nPlease ensure it exists or set 'PDF_PATH' environment variable.\n---------------------------\n")
|
706 |
exit(1) # This exit is correct: if file not found
|
707 |
|
|
|
|
|
708 |
if not os.access(PDF_PATH, os.R_OK):
|
709 |
logging.error(f"FATAL: PDF file at '{PDF_PATH}' exists but is not readable. Check file permissions.")
|
710 |
print(f"\n--- PERMISSION ERROR ---\nPDF file ('{os.path.basename(PDF_PATH)}') found but not readable at: {PDF_PATH}\nPlease check file permissions (e.g., using 'chmod +r' in terminal).\n---------------------------\n")
|