SarowarSaurav commited on
Commit
d61b17f
·
verified ·
1 Parent(s): af90672

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -42
app.py CHANGED
@@ -1,44 +1,6 @@
1
  import gradio as gr
2
 
3
- # Define the knowledge base as a dictionary
4
- knowledge_base = {
5
- "SOP": "Sales Operations Planning / Standard Operational Procedure / Start of Production",
6
- "NTO": "Net Turnover",
7
- "D&A": "Data & Analytics",
8
- "HOF": "Head of Function",
9
- "APFO": "Adjusted Profit from Operations",
10
- "LEP": "Limited Edition Pack",
11
- "ISC": "Integrated Supply Chain",
12
- "ISF": "In Store Furniture",
13
- "PED": "Primary Engineering Department",
14
- "EOB": "End of Business Day",
15
- "OOO": "Out of Office",
16
- }
17
-
18
- # Define the Gradio interface function
19
- def chatbot_interface(acronym):
20
- acronym = acronym.strip().upper() # Remove leading/trailing whitespace and convert to uppercase
21
- if acronym in knowledge_base:
22
- response = f"Answer: {knowledge_base[acronym]}"
23
- else:
24
- response = "Not found in the BATCCAPEDIA"
25
- return response
26
-
27
- # Create the Gradio interface with the logo
28
- logo_url = "https://www.batbangladesh.com/imgs/BAT_Bangladesh_Logo.png"
29
- iface = gr.Interface(
30
- fn=chatbot_interface,
31
- inputs="text",
32
- outputs="text",
33
- live=True, # Add a live preview for logo positioning
34
- css="footer{display:none !important} #img-overlay { position: fixed; top: 10px; right: 10px; z-index: 100; }",
35
- title="BATB Acronym Finder",
36
- description="Dictionary of Abbreviations & Acronyms",
37
- theme='default',
38
- examples=[
39
- ["SOP"],
40
- ["NTO"],
41
- ["D&A"],
42
- ],
43
- )
44
- iface.launch(inline=False, share=True) # Launch the interface
 
1
  import gradio as gr
2
 
3
+ with gr.Blocks() as demo:
4
+ gr.HTML("<img src='/BAT_Bangladesh_Logo.png' alt='image One'>")
5
+
6
+ demo.launch(allowed_paths=["BAT_Bangladesh_Logo.png"])