Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -17,10 +17,23 @@ from dotenv import load_dotenv
|
|
17 |
load_dotenv()
|
18 |
|
19 |
# Configure Gemini API
|
20 |
-
GEMINI_API_KEY = os.getenv("
|
21 |
genai.configure(api_key=GEMINI_API_KEY)
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# Custom CSS styling for dark mode
|
26 |
CUSTOM_CSS = """
|
@@ -427,6 +440,12 @@ def generate_pdf_report(state, analysis_options):
|
|
427 |
def create_interface():
|
428 |
"""Create Gradio interface with enhanced UI"""
|
429 |
state = SupplyChainState()
|
|
|
|
|
|
|
|
|
|
|
|
|
430 |
|
431 |
with gr.Blocks(css=CUSTOM_CSS, title="SupplyChainAI Navigator") as demo:
|
432 |
# Header
|
@@ -436,7 +455,11 @@ def create_interface():
|
|
436 |
### Intelligent Supply Chain Analysis & Optimization
|
437 |
An AI-powered platform for comprehensive supply chain analytics
|
438 |
""")
|
439 |
-
|
|
|
|
|
|
|
|
|
440 |
# Main Content Tabs
|
441 |
with gr.Tabs() as tabs:
|
442 |
# Data Upload Tab
|
|
|
17 |
load_dotenv()
|
18 |
|
19 |
# Configure Gemini API
|
20 |
+
GEMINI_API_KEY = os.getenv("gemini_api")
|
21 |
genai.configure(api_key=GEMINI_API_KEY)
|
22 |
+
generation_config = {
|
23 |
+
"temperature": 1,
|
24 |
+
"top_p": 0.95,
|
25 |
+
"top_k": 64,
|
26 |
+
"max_output_tokens": 8192,
|
27 |
+
"response_mime_type": "text/plain",
|
28 |
+
}
|
29 |
+
|
30 |
+
model = genai.GenerativeModel(
|
31 |
+
model_name="gemini-2.0-pro-exp-02-05",
|
32 |
+
generation_config=generation_config,
|
33 |
+
)
|
34 |
+
|
35 |
+
chat_model = genai.GenerativeModel('"gemini-2.0-pro-exp-02-05"')
|
36 |
+
|
37 |
|
38 |
# Custom CSS styling for dark mode
|
39 |
CUSTOM_CSS = """
|
|
|
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
|
|
|
455 |
### Intelligent Supply Chain Analysis & Optimization
|
456 |
An AI-powered platform for comprehensive supply chain analytics
|
457 |
""")
|
458 |
+
gr.Markdown("### Created by Aditya Ratan", elem_classes="creator-info")
|
459 |
+
# Add footer
|
460 |
+
with gr.Row(elem_classes="footer"):
|
461 |
+
gr.Markdown("Designed and Developed by Aditya Ratan | © 2025")
|
462 |
+
|
463 |
# Main Content Tabs
|
464 |
with gr.Tabs() as tabs:
|
465 |
# Data Upload Tab
|