SarowarSaurav commited on
Commit
82c0419
·
verified ·
1 Parent(s): 51beff0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -11
app.py CHANGED
@@ -3,6 +3,7 @@ import difflib
3
 
4
  # Define the knowledge base as a dictionary
5
  knowledge_base = {
 
6
  "SOP": "Sales Operations Planning / Standard Operational Procedure / Start of Production",
7
  "NTO": "Net Turnover",
8
  "D&A": "Data & Analytics",
@@ -2539,15 +2540,29 @@ def chatbot_interface(acronym):
2539
  return response
2540
 
2541
  # Create the Gradio interface
2542
- iface = gr.Interface(
2543
- fn=chatbot_interface,
2544
- inputs="text",
2545
- outputs="text",
2546
- css="footer{display:none !important}",
2547
- title="BATB Acronym Finder",
2548
- description="Dictionary of Abbreviations & Acronyms",
2549
- theme='default'
2550
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2551
 
2552
- # Launch the interface
2553
- iface.launch()
 
3
 
4
  # Define the knowledge base as a dictionary
5
  knowledge_base = {
6
+ "USP" : "Unique Selling Point",
7
  "SOP": "Sales Operations Planning / Standard Operational Procedure / Start of Production",
8
  "NTO": "Net Turnover",
9
  "D&A": "Data & Analytics",
 
2540
  return response
2541
 
2542
  # Create the Gradio interface
2543
+ css = """
2544
+ .gradio-container {
2545
+ background: rgb(14, 43, 99);
2546
+ display: flex;
2547
+ flex-direction: column;
2548
+ align-items: center;
2549
+ }
2550
+ """
2551
+
2552
+ # HTML content for the logo
2553
+ html_content = """
2554
+ <div style="text-align: center; margin-bottom: 20px;">
2555
+ <img src="https://i.ibb.co/82Qf4rc/APMEA-CENTRAL-White.png" border="0" alt='BAT Bangladesh Logo' style='max-width: 300px;'>
2556
+ </div>
2557
+ """
2558
+
2559
+ with gr.Blocks(css=css) as demo:
2560
+ gr.HTML(html_content)
2561
+ gr.Interface(
2562
+ fn=chatbot_interface,
2563
+ inputs=gr.Textbox(label="Acronym", placeholder="Enter Acronym Here"),
2564
+ outputs=gr.Textbox(label="Answer"),
2565
+ theme='upsatwal/mlsc_tiet',
2566
+ )
2567
 
2568
+ demo.launch(allowed_paths=["."])