KURUPRASATH-J commited on
Commit
5c06736
·
verified ·
1 Parent(s): 0770068

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -0
app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from text_rag import get_response
3
+ import json
4
+ import os
5
+
6
+ with open(os.path.abspath(os.path.join(os.path.dirname(__file__), "branding.json"))) as f:
7
+ brand_info = json.load(f)["brand"]
8
+
9
+ with gr.Blocks(theme="default", title=brand_info["organizationName"]) as rag_bot:
10
+ gr.HTML(f"""
11
+ <div style="display: flex; justify-content:center; margin-bottom:20px">
12
+ <img src="{brand_info["logo"]["title"]}" alt="{brand_info["organizationName"]} Logo" style="width:200px;height:40px">
13
+ </div> """)
14
+
15
+ gr.ChatInterface(
16
+ fn=get_response,
17
+ chatbot=gr.Chatbot(height=500, avatar_images=(None, brand_info["chatbot"]["avatar"]), type="messages"),
18
+ title=brand_info["organizationName"],
19
+ description=brand_info["slogan"],
20
+ type="messages",
21
+ examples=[
22
+ ["Who is the CEO of Here and Now AI?"],
23
+ ["What is the mission of Here and Now AI?"],
24
+ ["Tell me about the team behind Here and Now AI."]
25
+
26
+ ]
27
+ )
28
+
29
+ if __name__ == "__main__":
30
+ rag_bot.launch()