Nischal Subedi
commited on
Commit
·
4d60153
1
Parent(s):
4ebf92d
updated UI
Browse files
app.py
CHANGED
|
@@ -606,26 +606,29 @@ Answer:"""
|
|
| 606 |
box-shadow: inset 0 8px 15px rgba(0,0,0,0.2);
|
| 607 |
transition: background var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
|
| 608 |
max-width: 1120px; margin-left: auto; margin-right: auto; width: 100%;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 609 |
}
|
| 610 |
@media (prefers-color-scheme: light) {
|
| 611 |
.app-footer-wrapper { background: var(--header-bg-light); border-top: 1px solid var(--border-light) !important; box-shadow: inset 0 6px 12px rgba(0,0,0,0.1); }
|
| 612 |
}
|
| 613 |
-
.app-footer {
|
| 614 |
padding: 0 var(--padding-lg) !important;
|
| 615 |
display: flex;
|
| 616 |
flex-direction: column;
|
| 617 |
-
align-items: stretch; /*
|
| 618 |
-
|
| 619 |
-
margin: 0 auto;
|
| 620 |
}
|
| 621 |
-
.app-footer p {
|
| 622 |
font-size: 1.05rem !important;
|
| 623 |
color: var(--text-secondary-dark) !important;
|
| 624 |
margin-bottom: 1rem;
|
| 625 |
-
/*
|
| 626 |
-
text-align:
|
| 627 |
transition: color var(--transition-speed);
|
| 628 |
-
width: 100%; /*
|
| 629 |
}
|
| 630 |
.app-footer a { color: var(--accent-main-dark) !important; font-weight: 500; transition: color var(--transition-speed), text-decoration var(--transition-speed); }
|
| 631 |
.app-footer a:hover { color: var(--accent-hover-dark) !important; text-decoration: underline; }
|
|
@@ -795,7 +798,7 @@ Answer:"""
|
|
| 795 |
|
| 796 |
# --- Footer Section ---
|
| 797 |
with gr.Group(elem_classes="app-footer-wrapper"):
|
| 798 |
-
gr.Markdown(
|
| 799 |
"""
|
| 800 |
<div class="app-footer">
|
| 801 |
<p>This tool is for informational purposes only and does not constitute legal advice. For legal guidance, always consult with a licensed attorney in your jurisdiction.</p>
|
|
@@ -827,8 +830,8 @@ if __name__ == "__main__":
|
|
| 827 |
logging.info("Starting Landlord-Tenant Rights Bot application...")
|
| 828 |
try:
|
| 829 |
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 830 |
-
DEFAULT_PDF_PATH = os.path.join(SCRIPT_DIR, "tenant-landlord.pdf")
|
| 831 |
-
DEFAULT_DB_PATH = os.path.join(SCRIPT_DIR, "chroma_db")
|
| 832 |
|
| 833 |
PDF_PATH = os.getenv("PDF_PATH", DEFAULT_PDF_PATH)
|
| 834 |
VECTOR_DB_PATH = os.getenv("VECTOR_DB_PATH", DEFAULT_DB_PATH)
|
|
@@ -862,7 +865,7 @@ if __name__ == "__main__":
|
|
| 862 |
|
| 863 |
logging.info(f"Launching Gradio app on http://0.0.0.0:{SERVER_PORT}")
|
| 864 |
print(f"\n--- Gradio App Running ---\nAccess at: http://localhost:{SERVER_PORT} or your public Spaces URL\n--------------------------\n")
|
| 865 |
-
app_interface.launch(server_name="0.0.0.0", server_port=SERVER_PORT, share=
|
| 866 |
|
| 867 |
except ModuleNotFoundError as e:
|
| 868 |
if "vector_db" in str(e):
|
|
|
|
| 606 |
box-shadow: inset 0 8px 15px rgba(0,0,0,0.2);
|
| 607 |
transition: background var(--transition-speed), border-color var(--transition-speed), box-shadow var(--transition-speed);
|
| 608 |
max-width: 1120px; margin-left: auto; margin-right: auto; width: 100%;
|
| 609 |
+
/* MODIFIED: Align Markdown content to the left */
|
| 610 |
+
display: flex !important;
|
| 611 |
+
flex-direction: column !important;
|
| 612 |
+
align-items: flex-start !important; /* Pushes the Markdown component to the left */
|
| 613 |
}
|
| 614 |
@media (prefers-color-scheme: light) {
|
| 615 |
.app-footer-wrapper { background: var(--header-bg-light); border-top: 1px solid var(--border-light) !important; box-shadow: inset 0 6px 12px rgba(0,0,0,0.1); }
|
| 616 |
}
|
| 617 |
+
.app-footer {
|
| 618 |
padding: 0 var(--padding-lg) !important;
|
| 619 |
display: flex;
|
| 620 |
flex-direction: column;
|
| 621 |
+
align-items: stretch; /* Keep children (<p> tags) stretched to full width of this div */
|
| 622 |
+
width: 100%; /* Ensure this div takes full width inside its markdown container */
|
|
|
|
| 623 |
}
|
| 624 |
+
.app-footer p {
|
| 625 |
font-size: 1.05rem !important;
|
| 626 |
color: var(--text-secondary-dark) !important;
|
| 627 |
margin-bottom: 1rem;
|
| 628 |
+
/* MODIFIED: Align text to the left */
|
| 629 |
+
text-align: left !important;
|
| 630 |
transition: color var(--transition-speed);
|
| 631 |
+
width: 100%; /* Ensure <p> takes full width of stretched item */
|
| 632 |
}
|
| 633 |
.app-footer a { color: var(--accent-main-dark) !important; font-weight: 500; transition: color var(--transition-speed), text-decoration var(--transition-speed); }
|
| 634 |
.app-footer a:hover { color: var(--accent-hover-dark) !important; text-decoration: underline; }
|
|
|
|
| 798 |
|
| 799 |
# --- Footer Section ---
|
| 800 |
with gr.Group(elem_classes="app-footer-wrapper"):
|
| 801 |
+
gr.Markdown(
|
| 802 |
"""
|
| 803 |
<div class="app-footer">
|
| 804 |
<p>This tool is for informational purposes only and does not constitute legal advice. For legal guidance, always consult with a licensed attorney in your jurisdiction.</p>
|
|
|
|
| 830 |
logging.info("Starting Landlord-Tenant Rights Bot application...")
|
| 831 |
try:
|
| 832 |
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 833 |
+
DEFAULT_PDF_PATH = os.path.join(SCRIPT_DIR, "data/tenant-landlord.pdf")
|
| 834 |
+
DEFAULT_DB_PATH = os.path.join(SCRIPT_DIR, "data/chroma_db")
|
| 835 |
|
| 836 |
PDF_PATH = os.getenv("PDF_PATH", DEFAULT_PDF_PATH)
|
| 837 |
VECTOR_DB_PATH = os.getenv("VECTOR_DB_PATH", DEFAULT_DB_PATH)
|
|
|
|
| 865 |
|
| 866 |
logging.info(f"Launching Gradio app on http://0.0.0.0:{SERVER_PORT}")
|
| 867 |
print(f"\n--- Gradio App Running ---\nAccess at: http://localhost:{SERVER_PORT} or your public Spaces URL\n--------------------------\n")
|
| 868 |
+
app_interface.launch(server_name="0.0.0.0", server_port=SERVER_PORT, share=True) # share=False is typical for Spaces
|
| 869 |
|
| 870 |
except ModuleNotFoundError as e:
|
| 871 |
if "vector_db" in str(e):
|