Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,49 +98,65 @@ def gradio_fn(message, history):
|
|
| 98 |
)
|
| 99 |
|
| 100 |
with gr.Blocks(css="""
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
| 127 |
""") as demo:
|
| 128 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
chat = gr.ChatInterface(
|
| 130 |
fn=gradio_fn,
|
| 131 |
-
examples=[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
chatbot=gr.Chatbot(type="messages", elem_classes="chatbot"),
|
| 133 |
type="messages",
|
| 134 |
)
|
|
|
|
| 135 |
gr.HTML("""
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
""")
|
| 143 |
|
| 144 |
-
|
| 145 |
if __name__ == "__main__":
|
| 146 |
-
demo.launch()
|
|
|
|
| 98 |
)
|
| 99 |
|
| 100 |
with gr.Blocks(css="""
|
| 101 |
+
.gradio-container {
|
| 102 |
+
max-width: 600px;
|
| 103 |
+
margin: auto;
|
| 104 |
+
padding: 20px;
|
| 105 |
+
font-family: sans-serif;
|
| 106 |
+
position: relative;
|
| 107 |
+
}
|
| 108 |
+
.chatbot {
|
| 109 |
+
height: 500px !important;
|
| 110 |
+
overflow-y: auto;
|
| 111 |
+
}
|
| 112 |
+
.corner {
|
| 113 |
+
position: fixed;
|
| 114 |
+
bottom: 2px;
|
| 115 |
+
z-index: 9999;
|
| 116 |
+
pointer-events: none;
|
| 117 |
+
}
|
| 118 |
+
#left {
|
| 119 |
+
left: 2px;
|
| 120 |
+
}
|
| 121 |
+
#right {
|
| 122 |
+
right: 2px;
|
| 123 |
+
}
|
| 124 |
+
.corner img {
|
| 125 |
+
height: 500px; /* fixed height */
|
| 126 |
+
width: auto; /* auto to keep aspect ratio */
|
| 127 |
+
}
|
| 128 |
""") as demo:
|
| 129 |
+
|
| 130 |
+
gr.Markdown(
|
| 131 |
+
"""
|
| 132 |
+
<div style='text-align: center; padding: 10px;'>
|
| 133 |
+
<h1 style='font-size: 2.2em; margin-bottom: 0.2em;'><span style='color: #4F46E5;'>kRISHNA.ai</span></h1>
|
| 134 |
+
<p style='font-size: 1.1em; color: #555;'>5000-Years of Ancient WISDOM with Modern AI ✨</p>
|
| 135 |
+
</div>
|
| 136 |
+
""",
|
| 137 |
+
elem_id="header"
|
| 138 |
+
)
|
| 139 |
+
|
| 140 |
chat = gr.ChatInterface(
|
| 141 |
fn=gradio_fn,
|
| 142 |
+
examples=[
|
| 143 |
+
"Hello!",
|
| 144 |
+
"How can I overcome fear of failure?",
|
| 145 |
+
"How do I forgive someone who hurt me deeply?",
|
| 146 |
+
"What can I do to stop overthinking?"
|
| 147 |
+
],
|
| 148 |
chatbot=gr.Chatbot(type="messages", elem_classes="chatbot"),
|
| 149 |
type="messages",
|
| 150 |
)
|
| 151 |
+
|
| 152 |
gr.HTML("""
|
| 153 |
+
<div id="left" class="corner">
|
| 154 |
+
<img src="https://i.ibb.co/FhLg2yH/arjuna.png" alt="Arjun">
|
| 155 |
+
</div>
|
| 156 |
+
<div id="right" class="corner">
|
| 157 |
+
<img src="https://i.ibb.co/3sSDC6S/krishna.png" alt="Krishna">
|
| 158 |
+
</div>
|
| 159 |
""")
|
| 160 |
|
|
|
|
| 161 |
if __name__ == "__main__":
|
| 162 |
+
demo.launch()
|