Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -35,7 +35,7 @@ model = genai.GenerativeModel(
|
|
| 35 |
chat_model = genai.GenerativeModel('"gemini-2.0-pro-exp-02-05"')
|
| 36 |
|
| 37 |
|
| 38 |
-
#
|
| 39 |
CUSTOM_CSS = """
|
| 40 |
.gradio-container {
|
| 41 |
max-width: 1200px !important;
|
|
@@ -46,14 +46,101 @@ CUSTOM_CSS = """
|
|
| 46 |
}
|
| 47 |
|
| 48 |
.main-header {
|
| 49 |
-
background: linear-gradient(
|
| 50 |
color: white !important;
|
| 51 |
-
padding:
|
| 52 |
-
border-radius:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
margin-bottom: 20px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
text-align: center !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
.tab-content {
|
| 58 |
background: #2d2d2d !important;
|
| 59 |
padding: 20px !important;
|
|
@@ -440,12 +527,6 @@ def generate_pdf_report(state, analysis_options):
|
|
| 440 |
def create_interface():
|
| 441 |
"""Create Gradio interface with enhanced UI"""
|
| 442 |
state = SupplyChainState()
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
# Rest of the interface components remain the same...
|
| 447 |
-
|
| 448 |
-
|
| 449 |
|
| 450 |
with gr.Blocks(css=CUSTOM_CSS, title="SupplyChainAI Navigator") as demo:
|
| 451 |
# Header
|
|
@@ -453,10 +534,9 @@ def create_interface():
|
|
| 453 |
gr.Markdown("""
|
| 454 |
# π’ SupplyChainAI Navigator
|
| 455 |
### Intelligent Supply Chain Analysis & Optimization
|
| 456 |
-
An AI-powered platform for comprehensive supply chain analytics
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
# Main Content Tabs
|
| 461 |
with gr.Tabs() as tabs:
|
| 462 |
# Data Upload Tab
|
|
@@ -480,10 +560,7 @@ def create_interface():
|
|
| 480 |
label="π Supplier Data (Excel)",
|
| 481 |
elem_classes="file-upload"
|
| 482 |
)
|
| 483 |
-
|
| 484 |
-
with gr.Row(elem_classes="footer"):
|
| 485 |
-
gr.Markdown("Designed and Developed by Aditya Ratan | Β© 2025")
|
| 486 |
-
|
| 487 |
text_input_area = gr.Textbox(
|
| 488 |
label="π Additional Context",
|
| 489 |
placeholder="Add market updates, news, or other relevant information...",
|
|
@@ -500,8 +577,7 @@ def create_interface():
|
|
| 500 |
variant="primary",
|
| 501 |
elem_classes="action-button"
|
| 502 |
)
|
| 503 |
-
|
| 504 |
-
gr.Markdown("Designed and Developed by Aditya Ratan | Β© 2025")
|
| 505 |
# Analysis Selection Tab
|
| 506 |
with gr.Tab("π Analysis", elem_classes="tab-content"):
|
| 507 |
with gr.Row():
|
|
|
|
| 35 |
chat_model = genai.GenerativeModel('"gemini-2.0-pro-exp-02-05"')
|
| 36 |
|
| 37 |
|
| 38 |
+
# Enhanced CSS for better header styling
|
| 39 |
CUSTOM_CSS = """
|
| 40 |
.gradio-container {
|
| 41 |
max-width: 1200px !important;
|
|
|
|
| 46 |
}
|
| 47 |
|
| 48 |
.main-header {
|
| 49 |
+
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
|
| 50 |
color: white !important;
|
| 51 |
+
padding: 30px !important;
|
| 52 |
+
border-radius: 15px !important;
|
| 53 |
+
margin-bottom: 30px !important;
|
| 54 |
+
text-align: center !important;
|
| 55 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
.app-title {
|
| 59 |
+
font-size: 2.5em !important;
|
| 60 |
+
font-weight: bold !important;
|
| 61 |
+
margin-bottom: 10px !important;
|
| 62 |
+
background: linear-gradient(90deg, #ffffff, #3498DB) !important;
|
| 63 |
+
-webkit-background-clip: text !important;
|
| 64 |
+
-webkit-text-fill-color: transparent !important;
|
| 65 |
+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3) !important;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.app-subtitle {
|
| 69 |
+
font-size: 1.3em !important;
|
| 70 |
+
color: #89CFF0 !important;
|
| 71 |
+
margin-bottom: 15px !important;
|
| 72 |
+
font-weight: 500 !important;
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
.app-description {
|
| 76 |
+
font-size: 1.1em !important;
|
| 77 |
+
color: #B0C4DE !important;
|
| 78 |
margin-bottom: 20px !important;
|
| 79 |
+
line-height: 1.5 !important;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
.creator-info {
|
| 83 |
+
font-size: 1.2em !important;
|
| 84 |
+
color: #3498DB !important;
|
| 85 |
+
margin-top: 15px !important;
|
| 86 |
+
padding: 10px !important;
|
| 87 |
+
border-top: 2px solid rgba(52, 152, 219, 0.3) !important;
|
| 88 |
+
font-style: italic !important;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
[... rest of the CSS remains the same ...]"""
|
| 92 |
+
|
| 93 |
+
def create_interface():
|
| 94 |
+
"""Create Gradio interface with enhanced UI"""
|
| 95 |
+
state = SupplyChainState()
|
| 96 |
+
|
| 97 |
+
with gr.Blocks(css=CUSTOM_CSS, title="SupplyChainAI Navigator by Aditya Ratan") as demo:
|
| 98 |
+
# Enhanced Header
|
| 99 |
+
with gr.Row(elem_classes="main-header"):
|
| 100 |
+
with gr.Column():
|
| 101 |
+
gr.Markdown("# π’ SupplyChainAI Navigator", elem_classes="app-title")
|
| 102 |
+
gr.Markdown("### Intelligent Supply Chain Analysis & Optimization", elem_classes="app-subtitle")
|
| 103 |
+
gr.Markdown("An AI-powered platform for comprehensive supply chain analytics", elem_classes="app-description")
|
| 104 |
+
gr.Markdown("Created by Aditya Ratan", elem_classes="creator-info")
|
| 105 |
+
|
| 106 |
+
.creator-info {
|
| 107 |
+
color: #3498DB !important;
|
| 108 |
+
font-size: 1.2em !important;
|
| 109 |
+
text-align: right !important;
|
| 110 |
+
margin-top: 10px !important;
|
| 111 |
+
font-style: italic !important;
|
| 112 |
+
}
|
| 113 |
+
|
| 114 |
+
.footer {
|
| 115 |
text-align: center !important;
|
| 116 |
+
padding: 20px !important;
|
| 117 |
+
margin-top: 40px !important;
|
| 118 |
+
border-top: 1px solid #404040 !important;
|
| 119 |
+
color: #888888 !important;
|
| 120 |
}
|
| 121 |
|
| 122 |
+
[... rest of the CSS remains the same ...]"""
|
| 123 |
+
|
| 124 |
+
def create_interface():
|
| 125 |
+
"""Create Gradio interface with enhanced UI"""
|
| 126 |
+
state = SupplyChainState()
|
| 127 |
+
|
| 128 |
+
with gr.Blocks(css=CUSTOM_CSS, title="SupplyChainAI Navigator") as demo:
|
| 129 |
+
# Header
|
| 130 |
+
with gr.Row(elem_classes="main-header"):
|
| 131 |
+
gr.Markdown("""
|
| 132 |
+
# π’ SupplyChainAI Navigator
|
| 133 |
+
### Intelligent Supply Chain Analysis & Optimization
|
| 134 |
+
An AI-powered platform for comprehensive supply chain analytics
|
| 135 |
+
""")
|
| 136 |
+
gr.Markdown("### Created by Aditya Ratan", elem_classes="creator-info")
|
| 137 |
+
|
| 138 |
+
# Rest of the interface components remain the same...
|
| 139 |
+
|
| 140 |
+
# Add footer
|
| 141 |
+
with gr.Row(elem_classes="footer"):
|
| 142 |
+
gr.Markdown("Designed and Developed by Aditya Ratan | Β© 2025")
|
| 143 |
+
|
| 144 |
.tab-content {
|
| 145 |
background: #2d2d2d !important;
|
| 146 |
padding: 20px !important;
|
|
|
|
| 527 |
def create_interface():
|
| 528 |
"""Create Gradio interface with enhanced UI"""
|
| 529 |
state = SupplyChainState()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
|
| 531 |
with gr.Blocks(css=CUSTOM_CSS, title="SupplyChainAI Navigator") as demo:
|
| 532 |
# Header
|
|
|
|
| 534 |
gr.Markdown("""
|
| 535 |
# π’ SupplyChainAI Navigator
|
| 536 |
### Intelligent Supply Chain Analysis & Optimization
|
| 537 |
+
An AI-powered platform for comprehensive supply chain analytics
|
| 538 |
+
""")
|
| 539 |
+
|
|
|
|
| 540 |
# Main Content Tabs
|
| 541 |
with gr.Tabs() as tabs:
|
| 542 |
# Data Upload Tab
|
|
|
|
| 560 |
label="π Supplier Data (Excel)",
|
| 561 |
elem_classes="file-upload"
|
| 562 |
)
|
| 563 |
+
|
|
|
|
|
|
|
|
|
|
| 564 |
text_input_area = gr.Textbox(
|
| 565 |
label="π Additional Context",
|
| 566 |
placeholder="Add market updates, news, or other relevant information...",
|
|
|
|
| 577 |
variant="primary",
|
| 578 |
elem_classes="action-button"
|
| 579 |
)
|
| 580 |
+
|
|
|
|
| 581 |
# Analysis Selection Tab
|
| 582 |
with gr.Tab("π Analysis", elem_classes="tab-content"):
|
| 583 |
with gr.Row():
|