JDhruv14 commited on
Commit
3e2be9a
·
verified ·
1 Parent(s): 7d12e27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +52 -36
app.py CHANGED
@@ -98,49 +98,65 @@ def gradio_fn(message, history):
98
  )
99
 
100
  with gr.Blocks(css="""
101
- /* page */
102
- html, body { height: 100%; overflow-y: hidden; }
103
-
104
- /* app container should always be visible & above images */
105
- .gradio-container {
106
- max-width: 600px;
107
- margin: auto;
108
- padding: 20px;
109
- font-family: sans-serif;
110
- position: relative;
111
- min-height: 100vh; /* ensures layout space */
112
- z-index: 10; /* sit above corner images */
113
- }
114
-
115
- .chatbot { height: 500px !important; overflow-y: auto; }
116
-
117
- /* corner images */
118
- .corner { position: fixed; pointer-events: none; z-index: 5; } /* < z-index of container */
119
- #left { left: 8px; bottom: 8px; }
120
- #right { right: 8px; bottom: 100px; } /* lift Krishna a bit */
121
-
122
- .corner img {
123
- height: min(70vh, 900px); /* bigger but responsive */
124
- width: auto;
125
- display: block;
126
- }
 
127
  """) as demo:
128
- gr.Markdown(...)
 
 
 
 
 
 
 
 
 
 
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
- <div id="left" class="corner">
137
- <img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">
138
- </div>
139
- <div id="right" class="corner">
140
- <img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/krishna.png" alt="Krishna">
141
- </div>
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()