Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -98,52 +98,41 @@ def gradio_fn(message, history):
|
|
| 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 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
}
|
| 112 |
.corner {
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
#
|
| 119 |
-
|
| 120 |
.corner img {
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
)
|
| 135 |
-
chat = gr.ChatInterface(
|
| 136 |
-
fn=gradio_fn,
|
| 137 |
-
examples=[
|
| 138 |
-
"Hello!",
|
| 139 |
-
"How can I overcome fear of failure?",
|
| 140 |
-
"How do I forgive someone who hurt me deeply?",
|
| 141 |
-
"What can I do to stop overthinking?"
|
| 142 |
-
],
|
| 143 |
-
chatbot=gr.Chatbot(type="messages", elem_classes="chatbot"),
|
| 144 |
-
type="messages",
|
| 145 |
-
)
|
| 146 |
-
gr.HTML(f"""
|
| 147 |
<div id="left" class="corner">
|
| 148 |
<img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">
|
| 149 |
</div>
|
|
@@ -152,5 +141,6 @@ with gr.Blocks(css="""
|
|
| 152 |
</div>
|
| 153 |
""")
|
| 154 |
|
|
|
|
| 155 |
if __name__ == "__main__":
|
| 156 |
demo.launch()
|
|
|
|
| 98 |
)
|
| 99 |
|
| 100 |
with gr.Blocks(css="""
|
| 101 |
+
:root { --corner-h: min(65vh, 820px); } /* bigger images, size caps to viewport */
|
| 102 |
+
|
| 103 |
+
html, body { overflow-y: hidden; } /* no vertical scroll */
|
| 104 |
.gradio-container {
|
| 105 |
max-width: 600px;
|
| 106 |
margin: auto;
|
| 107 |
padding: 20px;
|
| 108 |
font-family: sans-serif;
|
| 109 |
position: relative;
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
.chatbot { height: 500px !important; overflow-y: auto; }
|
| 113 |
+
|
|
|
|
| 114 |
.corner {
|
| 115 |
+
position: fixed;
|
| 116 |
+
z-index: 9999;
|
| 117 |
+
pointer-events: none;
|
| 118 |
+
}
|
| 119 |
+
#left { left: 8px; bottom: 8px; } /* Arjuna pinned to bottom-left */
|
| 120 |
+
#right { right: 8px; bottom: 88px; } /* Krishna lifted ~80–90px */
|
| 121 |
+
|
| 122 |
.corner img {
|
| 123 |
+
height: var(--corner-h);
|
| 124 |
+
width: auto;
|
| 125 |
+
display: block;
|
| 126 |
+
}
|
| 127 |
+
|
| 128 |
+
/* safety on short screens: scale down a bit so nothing gets cramped */
|
| 129 |
+
@media (max-height: 740px) {
|
| 130 |
+
:root { --corner-h: 50vh; }
|
| 131 |
+
#right { bottom: 72px; }
|
| 132 |
+
}
|
| 133 |
+
""") as demo:
|
| 134 |
+
...
|
| 135 |
+
gr.HTML("""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
<div id="left" class="corner">
|
| 137 |
<img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">
|
| 138 |
</div>
|
|
|
|
| 141 |
</div>
|
| 142 |
""")
|
| 143 |
|
| 144 |
+
|
| 145 |
if __name__ == "__main__":
|
| 146 |
demo.launch()
|