Spaces:
Sleeping
Sleeping
Palbha Kulkarni (Nazwale)
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -4,16 +4,63 @@ from baseline_code import *
|
|
4 |
|
5 |
# Qatar Airways-style theme
|
6 |
custom_css = """
|
7 |
-
body {
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
"""
|
16 |
|
|
|
17 |
# Model-specific response logic
|
18 |
def get_response(message, chat_history, model_choice, api_key):
|
19 |
chat_history.append({'role':"user","content":message})
|
@@ -41,7 +88,7 @@ with gr.Blocks(css=custom_css) as app:
|
|
41 |
)
|
42 |
|
43 |
with gr.Column(scale=3):
|
44 |
-
gr.Markdown("<h1>✈️
|
45 |
chatbot = gr.Chatbot(label="Assistant", height=400,type="messages")
|
46 |
msg = gr.Textbox(label="Your Message")
|
47 |
state = gr.State([])
|
|
|
4 |
|
5 |
# Qatar Airways-style theme
|
6 |
custom_css = """
|
7 |
+
body {
|
8 |
+
background-color: #f5f5dc;
|
9 |
+
margin: 0;
|
10 |
+
padding: 0;
|
11 |
+
}
|
12 |
+
|
13 |
+
.gradio-container {
|
14 |
+
font-family: 'Lato', sans-serif;
|
15 |
+
padding: 20px;
|
16 |
+
}
|
17 |
+
|
18 |
+
h1 {
|
19 |
+
color: #5c0a0a;
|
20 |
+
}
|
21 |
+
|
22 |
+
textarea, input, .message {
|
23 |
+
background-color: #fff8f0 !important;
|
24 |
+
color: #333 !important;
|
25 |
+
border-radius: 8px !important;
|
26 |
+
border: 1px solid #ddd !important;
|
27 |
+
}
|
28 |
+
|
29 |
+
.message.user {
|
30 |
+
border-left: 4px solid #5c0a0a;
|
31 |
+
padding-left: 8px;
|
32 |
+
margin-bottom: 10px;
|
33 |
+
}
|
34 |
+
|
35 |
+
.message.assistant {
|
36 |
+
border-left: 4px solid #d4af37;
|
37 |
+
padding-left: 8px;
|
38 |
+
margin-bottom: 10px;
|
39 |
+
}
|
40 |
+
|
41 |
+
button {
|
42 |
+
background-color: #5c0a0a !important;
|
43 |
+
color: white !important;
|
44 |
+
border-radius: 10px !important;
|
45 |
+
padding: 8px 16px;
|
46 |
+
border: none;
|
47 |
+
}
|
48 |
+
|
49 |
+
button:hover {
|
50 |
+
background-color: #a01010 !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
.gr-chatbot {
|
54 |
+
background-color: #fffdf5 !important;
|
55 |
+
border: 1px solid #ddd !important;
|
56 |
+
border-radius: 10px !important;
|
57 |
+
padding: 10px;
|
58 |
+
max-height: 400px;
|
59 |
+
overflow-y: auto;
|
60 |
+
}
|
61 |
"""
|
62 |
|
63 |
+
|
64 |
# Model-specific response logic
|
65 |
def get_response(message, chat_history, model_choice, api_key):
|
66 |
chat_history.append({'role':"user","content":message})
|
|
|
88 |
)
|
89 |
|
90 |
with gr.Column(scale=3):
|
91 |
+
gr.Markdown("<h1>✈️ AirlineX Airways Virtual Assistant</h1>")
|
92 |
chatbot = gr.Chatbot(label="Assistant", height=400,type="messages")
|
93 |
msg = gr.Textbox(label="Your Message")
|
94 |
state = gr.State([])
|