Update space
Browse files
app.py
CHANGED
@@ -94,12 +94,59 @@ Add wisdom or reflection to enhance the response."""}]
|
|
94 |
# yield yoda_response
|
95 |
yield response
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
"""
|
99 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
100 |
"""
|
101 |
demo = gr.ChatInterface(
|
102 |
respond,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
# additional_inputs=[
|
104 |
# gr.Textbox(value="You are Yoda from Star Wars.", label="System message"),
|
105 |
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
|
|
94 |
# yield yoda_response
|
95 |
yield response
|
96 |
|
97 |
+
# Customizing the Interface
|
98 |
+
title = "🛸 Yoda's Wisdom Chatbot"
|
99 |
+
description = """
|
100 |
+
<strong>Welcome to Yoda's Wisdom Chatbot!</strong><br>
|
101 |
+
Speak with the wise and cryptic Yoda. Engage in conversations filled with wisdom, reflection, and a touch of Star Wars magic.<br>
|
102 |
+
<i>To the Force, closer you will feel. Ask away, young Padawan!</i>
|
103 |
+
"""
|
104 |
+
|
105 |
+
# Define custom CSS for styling
|
106 |
+
custom_css = """
|
107 |
+
#chatbot-header {
|
108 |
+
background-color: #000000;
|
109 |
+
color: #00ff00;
|
110 |
+
font-family: 'Courier New', monospace;
|
111 |
+
font-size: 24px;
|
112 |
+
padding: 10px;
|
113 |
+
text-align: center;
|
114 |
+
border-bottom: 2px solid #00ff00;
|
115 |
+
}
|
116 |
+
|
117 |
+
#chatbot-container {
|
118 |
+
background-image: url('https://wallpapercave.com/wp/wp5218303.jpg');
|
119 |
+
background-size: cover;
|
120 |
+
color: white;
|
121 |
+
padding: 20px;
|
122 |
+
}
|
123 |
+
|
124 |
+
.gr-button {
|
125 |
+
background-color: #00ff00 !important;
|
126 |
+
color: black !important;
|
127 |
+
font-size: 16px !important;
|
128 |
+
border-radius: 8px !important;
|
129 |
+
padding: 8px 16px !important;
|
130 |
+
border: none !important;
|
131 |
+
}
|
132 |
+
"""
|
133 |
|
134 |
"""
|
135 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
136 |
"""
|
137 |
demo = gr.ChatInterface(
|
138 |
respond,
|
139 |
+
title=title,
|
140 |
+
description=description,
|
141 |
+
theme="compact",
|
142 |
+
css=custom_css,
|
143 |
+
additional_inputs=[
|
144 |
+
gr.Textbox(
|
145 |
+
label="Type your message",
|
146 |
+
placeholder="Ask Yoda anything...",
|
147 |
+
lines=3,
|
148 |
+
)
|
149 |
+
],
|
150 |
# additional_inputs=[
|
151 |
# gr.Textbox(value="You are Yoda from Star Wars.", label="System message"),
|
152 |
# gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|