Update app.py
Browse files
app.py
CHANGED
@@ -40,9 +40,67 @@ def respond(
|
|
40 |
yield response
|
41 |
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
"""
|
44 |
-
|
45 |
-
|
46 |
demo = gr.ChatInterface(
|
47 |
respond,
|
48 |
additional_inputs=[
|
@@ -57,6 +115,7 @@ demo = gr.ChatInterface(
|
|
57 |
label="Top-p (nucleus sampling)",
|
58 |
),
|
59 |
],
|
|
|
60 |
)
|
61 |
|
62 |
|
|
|
40 |
yield response
|
41 |
|
42 |
|
43 |
+
# Define custom CSS for Flat Design
|
44 |
+
flat_design_css = """
|
45 |
+
* {
|
46 |
+
margin: 0;
|
47 |
+
padding: 0;
|
48 |
+
box-sizing: border-box;
|
49 |
+
font-family: 'Helvetica', sans-serif;
|
50 |
+
}
|
51 |
+
|
52 |
+
.gradio-container {
|
53 |
+
background-color: #f4f4f9;
|
54 |
+
padding: 20px;
|
55 |
+
border-radius: 8px;
|
56 |
+
}
|
57 |
+
|
58 |
+
.gradio-button {
|
59 |
+
background-color: #4CAF50;
|
60 |
+
color: white;
|
61 |
+
border: none;
|
62 |
+
border-radius: 5px;
|
63 |
+
padding: 10px 20px;
|
64 |
+
font-size: 16px;
|
65 |
+
cursor: pointer;
|
66 |
+
transition: background-color 0.3s ease;
|
67 |
+
}
|
68 |
+
|
69 |
+
.gradio-button:hover {
|
70 |
+
background-color: #45a049;
|
71 |
+
}
|
72 |
+
|
73 |
+
.gradio-slider {
|
74 |
+
background-color: #e1e1e1;
|
75 |
+
border-radius: 8px;
|
76 |
+
}
|
77 |
+
|
78 |
+
.gradio-textbox {
|
79 |
+
background-color: #ffffff;
|
80 |
+
border: 1px solid #ddd;
|
81 |
+
border-radius: 8px;
|
82 |
+
padding: 10px;
|
83 |
+
font-size: 14px;
|
84 |
+
width: 100%;
|
85 |
+
transition: border-color 0.3s ease;
|
86 |
+
}
|
87 |
+
|
88 |
+
.gradio-textbox:focus {
|
89 |
+
border-color: #4CAF50;
|
90 |
+
}
|
91 |
+
|
92 |
+
.gradio-label {
|
93 |
+
font-size: 14px;
|
94 |
+
font-weight: bold;
|
95 |
+
color: #333;
|
96 |
+
}
|
97 |
+
|
98 |
+
.gradio-interface .gradio-input-container {
|
99 |
+
margin-bottom: 20px;
|
100 |
+
}
|
101 |
"""
|
102 |
+
|
103 |
+
# Launch the Gradio app with custom CSS
|
104 |
demo = gr.ChatInterface(
|
105 |
respond,
|
106 |
additional_inputs=[
|
|
|
115 |
label="Top-p (nucleus sampling)",
|
116 |
),
|
117 |
],
|
118 |
+
css=flat_design_css, # Applying the custom CSS
|
119 |
)
|
120 |
|
121 |
|