Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,10 +14,10 @@ def chat_with_model(user_input):
|
|
14 |
)
|
15 |
return response['choices'][0]['message']['content']
|
16 |
|
17 |
-
# Define CSS for
|
18 |
custom_css = """
|
19 |
body {
|
20 |
-
background-color: #f0f9ff;
|
21 |
font-family: 'Arial', sans-serif;
|
22 |
}
|
23 |
.gradio-container {
|
@@ -26,23 +26,33 @@ custom_css = """
|
|
26 |
padding: 30px;
|
27 |
background-color: #ffffff;
|
28 |
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
|
|
|
|
29 |
}
|
30 |
h1 {
|
31 |
color: #4a90e2;
|
32 |
text-align: center;
|
33 |
font-size: 28px;
|
34 |
}
|
35 |
-
|
36 |
-
|
37 |
-
color: #333333;
|
38 |
-
text-align: center;
|
39 |
-
}
|
40 |
-
input, textarea {
|
41 |
-
border: 2px solid #b3d9ff;
|
42 |
-
border-radius: 10px;
|
43 |
padding: 15px;
|
|
|
|
|
44 |
width: 100%;
|
45 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46 |
}
|
47 |
.gr-button {
|
48 |
background-color: #4da6ff;
|
@@ -53,14 +63,13 @@ custom_css = """
|
|
53 |
font-size: 18px;
|
54 |
cursor: pointer;
|
55 |
margin-top: 20px;
|
56 |
-
display: block;
|
57 |
width: 100%;
|
58 |
}
|
59 |
.gr-button:hover {
|
60 |
background-color: #3399ff;
|
61 |
}
|
62 |
.gradio-container:before {
|
63 |
-
content: "💬
|
64 |
display: block;
|
65 |
text-align: center;
|
66 |
font-size: 24px;
|
@@ -72,10 +81,10 @@ custom_css = """
|
|
72 |
# Create the Gradio interface
|
73 |
iface = gr.Interface(
|
74 |
fn=chat_with_model,
|
75 |
-
inputs="
|
76 |
-
outputs="
|
77 |
title="Friendly Medical Chatbot",
|
78 |
-
description="
|
79 |
theme="default",
|
80 |
css=custom_css
|
81 |
)
|
|
|
14 |
)
|
15 |
return response['choices'][0]['message']['content']
|
16 |
|
17 |
+
# Define CSS for chat-like appearance
|
18 |
custom_css = """
|
19 |
body {
|
20 |
+
background-color: #f0f9ff;
|
21 |
font-family: 'Arial', sans-serif;
|
22 |
}
|
23 |
.gradio-container {
|
|
|
26 |
padding: 30px;
|
27 |
background-color: #ffffff;
|
28 |
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
|
29 |
+
max-width: 600px;
|
30 |
+
margin: auto;
|
31 |
}
|
32 |
h1 {
|
33 |
color: #4a90e2;
|
34 |
text-align: center;
|
35 |
font-size: 28px;
|
36 |
}
|
37 |
+
.input-textbox, .output-textbox {
|
38 |
+
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
padding: 15px;
|
40 |
+
border-radius: 20px;
|
41 |
+
margin: 10px 0;
|
42 |
width: 100%;
|
43 |
+
font-size: 16px;
|
44 |
+
}
|
45 |
+
.input-textbox {
|
46 |
+
background-color: #e0f7fa;
|
47 |
+
border: 2px solid #b3e0ff;
|
48 |
+
color: #333;
|
49 |
+
text-align: left;
|
50 |
+
}
|
51 |
+
.output-textbox {
|
52 |
+
background-color: #e6eeff;
|
53 |
+
border: 2px solid #4a90e2;
|
54 |
+
color: #333;
|
55 |
+
text-align: left;
|
56 |
}
|
57 |
.gr-button {
|
58 |
background-color: #4da6ff;
|
|
|
63 |
font-size: 18px;
|
64 |
cursor: pointer;
|
65 |
margin-top: 20px;
|
|
|
66 |
width: 100%;
|
67 |
}
|
68 |
.gr-button:hover {
|
69 |
background-color: #3399ff;
|
70 |
}
|
71 |
.gradio-container:before {
|
72 |
+
content: "💬 Xin chào, tôi có thể giúp gì cho bạn?";
|
73 |
display: block;
|
74 |
text-align: center;
|
75 |
font-size: 24px;
|
|
|
81 |
# Create the Gradio interface
|
82 |
iface = gr.Interface(
|
83 |
fn=chat_with_model,
|
84 |
+
inputs=gr.Textbox(placeholder="Hãy hỏi ở đây...", css_class="input-textbox"),
|
85 |
+
outputs=gr.Textbox(label="Assistant", css_class="output-textbox"),
|
86 |
title="Friendly Medical Chatbot",
|
87 |
+
description="Bạn có thể hỏi mọi câu hỏi liên quan đến y tế",
|
88 |
theme="default",
|
89 |
css=custom_css
|
90 |
)
|