Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,7 @@ def respond(message, history: list[dict[str, str]]):
|
|
| 23 |
response += msg.choices[0].delta.content
|
| 24 |
yield response
|
| 25 |
|
| 26 |
-
|
| 27 |
-
# π Improved Purple + White/Grey Theme CSS + Footer Hide
|
| 28 |
custom_css = """
|
| 29 |
.gradio-container {
|
| 30 |
background: linear-gradient(to bottom right, #7E498B, #f5f5f5);
|
|
@@ -33,6 +32,19 @@ custom_css = """
|
|
| 33 |
padding: 20px;
|
| 34 |
}
|
| 35 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
/* Chat box styling */
|
| 37 |
.svelte-1ipelgc, .svelte-1f354aw {
|
| 38 |
border-radius: 16px !important;
|
|
@@ -91,7 +103,7 @@ button:hover {
|
|
| 91 |
to {opacity: 1; transform: translateY(0);}
|
| 92 |
}
|
| 93 |
|
| 94 |
-
/* π Hide Gradio Footer (API, Logo, Settings) */
|
| 95 |
footer, .svelte-1yycg3h, .builder-bar, .wrap.svelte-1ipelgc {
|
| 96 |
display: none !important;
|
| 97 |
visibility: hidden !important;
|
|
@@ -99,6 +111,10 @@ footer, .svelte-1yycg3h, .builder-bar, .wrap.svelte-1ipelgc {
|
|
| 99 |
"""
|
| 100 |
|
| 101 |
with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
gr.ChatInterface(respond, type="messages")
|
| 103 |
|
| 104 |
if __name__ == "__main__":
|
|
|
|
| 23 |
response += msg.choices[0].delta.content
|
| 24 |
yield response
|
| 25 |
|
| 26 |
+
# π Improved CSS + Footer Hide + Custom Header
|
|
|
|
| 27 |
custom_css = """
|
| 28 |
.gradio-container {
|
| 29 |
background: linear-gradient(to bottom right, #7E498B, #f5f5f5);
|
|
|
|
| 32 |
padding: 20px;
|
| 33 |
}
|
| 34 |
|
| 35 |
+
/* Custom header */
|
| 36 |
+
.custom-header {
|
| 37 |
+
text-align: center;
|
| 38 |
+
font-size: 26px;
|
| 39 |
+
font-weight: 700;
|
| 40 |
+
color: #7E498B;
|
| 41 |
+
margin-bottom: 16px;
|
| 42 |
+
padding: 12px 20px;
|
| 43 |
+
border-radius: 12px;
|
| 44 |
+
background: linear-gradient(135deg, #f5f5f5, #ffffff);
|
| 45 |
+
box-shadow: 0px 4px 12px rgba(0,0,0,0.1);
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
/* Chat box styling */
|
| 49 |
.svelte-1ipelgc, .svelte-1f354aw {
|
| 50 |
border-radius: 16px !important;
|
|
|
|
| 103 |
to {opacity: 1; transform: translateY(0);}
|
| 104 |
}
|
| 105 |
|
| 106 |
+
/* π Hide Gradio Footer (API, Logo, Settings) only */
|
| 107 |
footer, .svelte-1yycg3h, .builder-bar, .wrap.svelte-1ipelgc {
|
| 108 |
display: none !important;
|
| 109 |
visibility: hidden !important;
|
|
|
|
| 111 |
"""
|
| 112 |
|
| 113 |
with gr.Blocks(theme=gr.themes.Soft(), css=custom_css) as demo:
|
| 114 |
+
# β
Custom header at top
|
| 115 |
+
gr.HTML("<div class='custom-header'>π¬ VirtualTrainR Assistant</div>")
|
| 116 |
+
|
| 117 |
+
# Chat interface (default blue title + icons preserved if needed)
|
| 118 |
gr.ChatInterface(respond, type="messages")
|
| 119 |
|
| 120 |
if __name__ == "__main__":
|