Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,42 +96,50 @@ def gradio_fn(message, history):
|
|
| 96 |
max_new=512,
|
| 97 |
min_new=0,
|
| 98 |
)
|
| 99 |
-
|
| 100 |
with gr.Blocks(css="""
|
|
|
|
|
|
|
| 101 |
.gradio-container {
|
| 102 |
-
max-width:
|
| 103 |
-
|
|
|
|
|
|
|
| 104 |
padding: 20px;
|
| 105 |
font-family: sans-serif;
|
| 106 |
position: relative;
|
| 107 |
}
|
|
|
|
| 108 |
.chatbot {
|
| 109 |
-
height:
|
| 110 |
overflow-y: auto;
|
| 111 |
}
|
|
|
|
|
|
|
| 112 |
.corner {
|
| 113 |
position: fixed;
|
| 114 |
-
bottom:
|
| 115 |
-
z-index:
|
| 116 |
pointer-events: none;
|
| 117 |
}
|
| 118 |
-
#left
|
| 119 |
-
|
| 120 |
-
}
|
| 121 |
-
#right {
|
| 122 |
-
right: 2px;
|
| 123 |
-
}
|
| 124 |
.corner img {
|
| 125 |
-
height:
|
| 126 |
-
width: auto;
|
| 127 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
""") as demo:
|
| 129 |
|
| 130 |
gr.Markdown(
|
| 131 |
"""
|
| 132 |
-
<div style='text-align:
|
| 133 |
-
<h1 style='font-size: 2.
|
| 134 |
-
<p style='font-size: 1.
|
| 135 |
</div>
|
| 136 |
""",
|
| 137 |
elem_id="header"
|
|
@@ -151,10 +159,10 @@ with gr.Blocks(css="""
|
|
| 151 |
|
| 152 |
gr.HTML("""
|
| 153 |
<div id="left" class="corner">
|
| 154 |
-
<img src="" alt="Arjun">
|
| 155 |
</div>
|
| 156 |
<div id="right" class="corner">
|
| 157 |
-
<img src="" alt="Krishna">
|
| 158 |
</div>
|
| 159 |
""")
|
| 160 |
|
|
|
|
| 96 |
max_new=512,
|
| 97 |
min_new=0,
|
| 98 |
)
|
|
|
|
| 99 |
with gr.Blocks(css="""
|
| 100 |
+
:root { --chat-w: 520px; } /* ↓ change this to shrink/grow the chat */
|
| 101 |
+
|
| 102 |
.gradio-container {
|
| 103 |
+
max-width: var(--chat-w); /* narrower chat */
|
| 104 |
+
width: var(--chat-w);
|
| 105 |
+
margin-left: 16px; /* align left */
|
| 106 |
+
margin-right: auto; /* push away from right */
|
| 107 |
padding: 20px;
|
| 108 |
font-family: sans-serif;
|
| 109 |
position: relative;
|
| 110 |
}
|
| 111 |
+
|
| 112 |
.chatbot {
|
| 113 |
+
height: 480px !important; /* a bit smaller; tweak as you like */
|
| 114 |
overflow-y: auto;
|
| 115 |
}
|
| 116 |
+
|
| 117 |
+
/* corner images (optional) */
|
| 118 |
.corner {
|
| 119 |
position: fixed;
|
| 120 |
+
bottom: 8px;
|
| 121 |
+
z-index: 5;
|
| 122 |
pointer-events: none;
|
| 123 |
}
|
| 124 |
+
#left { left: 8px; }
|
| 125 |
+
#right { right: 8px; bottom: 96px; } /* lift Krishna a bit */
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
.corner img {
|
| 127 |
+
height: min(62vh, 760px);
|
| 128 |
+
width: auto;
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
/* mobile safety */
|
| 132 |
+
@media (max-width: 720px){
|
| 133 |
+
:root { --chat-w: 92vw; }
|
| 134 |
+
.gradio-container { margin-left: 4vw; }
|
| 135 |
+
}
|
| 136 |
""") as demo:
|
| 137 |
|
| 138 |
gr.Markdown(
|
| 139 |
"""
|
| 140 |
+
<div style='text-align: left; padding: 10px;'>
|
| 141 |
+
<h1 style='font-size: 2.0em; margin-bottom: 0.2em;'><span style='color: #4F46E5;'>kRISHNA.ai</span></h1>
|
| 142 |
+
<p style='font-size: 1.0em; color: #bbb;'>5000-Years of Ancient WISDOM with Modern AI ✨</p>
|
| 143 |
</div>
|
| 144 |
""",
|
| 145 |
elem_id="header"
|
|
|
|
| 159 |
|
| 160 |
gr.HTML("""
|
| 161 |
<div id="left" class="corner">
|
| 162 |
+
<img src="/file=arjuna.png" alt="Arjun">
|
| 163 |
</div>
|
| 164 |
<div id="right" class="corner">
|
| 165 |
+
<img src="/file=krishna.png" alt="Krishna">
|
| 166 |
</div>
|
| 167 |
""")
|
| 168 |
|