sagar007 commited on
Commit
16a3f05
·
verified ·
1 Parent(s): 74f149f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +90 -47
app.py CHANGED
@@ -126,57 +126,89 @@ def indic_language_assistant(input_type, audio_input, text_input):
126
  error_message = f"An error occurred: {str(e)}"
127
  return error_message, error_message, None
128
 
129
- # Custom CSS
130
  custom_css = """
131
  body {
132
- background-color: #1a1a1a;
133
- color: #ffffff;
134
  font-family: Arial, sans-serif;
135
  }
136
 
137
- .container {
138
- max-width: 800px;
139
- margin: 0 auto;
140
  padding: 20px;
 
 
 
141
  }
142
 
143
- h1 {
144
- font-size: 2.5em;
145
- background: linear-gradient(45deg, #4a90e2, #f48fb1);
146
- -webkit-background-clip: text;
147
- -webkit-text-fill-color: transparent;
148
  margin-bottom: 10px;
149
  }
150
 
151
- h2 {
152
- color: #a0a0a0;
153
- font-weight: normal;
 
 
154
  }
155
 
156
- .task-container {
157
- display: flex;
158
- justify-content: space-between;
159
- flex-wrap: wrap;
160
- margin-top: 30px;
161
  }
162
 
163
- .task-card {
164
- background-color: #2a2a2a;
165
  border-radius: 10px;
166
- padding: 15px;
167
- margin: 10px 0;
168
- width: calc(50% - 10px);
169
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
170
- transition: transform 0.3s ease;
171
  }
172
 
173
- .task-card:hover {
174
- transform: translateY(-5px);
 
 
 
 
 
 
 
 
 
 
175
  }
176
 
177
- .task-icon {
178
- font-size: 24px;
179
- margin-bottom: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
  }
181
 
182
  .input-box {
@@ -184,13 +216,13 @@ h2 {
184
  padding: 10px;
185
  border-radius: 20px;
186
  border: none;
187
- background-color: #333;
188
- color: #fff;
189
  margin-top: 20px;
190
  }
191
 
192
  .submit-btn {
193
- background-color: #4a90e2;
194
  color: white;
195
  border: none;
196
  padding: 10px 20px;
@@ -201,23 +233,34 @@ h2 {
201
  }
202
 
203
  .submit-btn:hover {
204
- background-color: #3a7bd5;
205
  }
206
  """
207
 
208
- # Custom HTML
209
  custom_html = """
210
- <div class="container">
211
- <h1>Hello, User</h1>
212
- <h2>How can I help you today?</h2>
213
- <div class="task-container">
214
- <div class="task-card">
215
- <div class="task-icon">🎤</div>
216
- <p>Speak in any Indic language</p>
 
 
 
 
 
 
 
 
 
 
 
217
  </div>
218
- <div class="task-card">
219
- <div class="task-icon">⌨️</div>
220
- <p>Type in any Indic language</p>
221
  </div>
222
  </div>
223
  </div>
@@ -239,8 +282,8 @@ iface = gr.Interface(
239
  title="Indic Language Virtual Assistant",
240
  description="Speak or type in any supported Indic language or English. The assistant will respond in text and audio.",
241
  css=custom_css,
242
- elem_id="indic-assistant",
243
- theme="dark"
244
  )
245
 
246
  # Launch the app
 
126
  error_message = f"An error occurred: {str(e)}"
127
  return error_message, error_message, None
128
 
129
+ # Updated Custom CSS
130
  custom_css = """
131
  body {
132
+ background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
 
133
  font-family: Arial, sans-serif;
134
  }
135
 
136
+ #indic-assistant {
137
+ text-align: center;
138
+ background: rgba(255, 255, 255, 0.8);
139
  padding: 20px;
140
+ border-radius: 10px;
141
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
142
+ position: relative;
143
  }
144
 
145
+ #indic-assistant h1 {
146
+ color: #4CAF50;
147
+ font-size: 2em;
 
 
148
  margin-bottom: 10px;
149
  }
150
 
151
+ .concept {
152
+ position: relative;
153
+ transition: transform 0.3s;
154
+ display: inline-block;
155
+ margin: 0 10px;
156
  }
157
 
158
+ .concept:hover {
159
+ transform: scale(1.1);
 
 
 
160
  }
161
 
162
+ .concept img {
163
+ width: 100px;
164
  border-radius: 10px;
 
 
 
165
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
166
  }
167
 
168
+ .concept-description {
169
+ position: absolute;
170
+ bottom: -30px;
171
+ left: 50%;
172
+ transform: translateX(-50%);
173
+ background-color: #4CAF50;
174
+ color: white;
175
+ padding: 5px 10px;
176
+ border-radius: 5px;
177
+ opacity: 0;
178
+ transition: opacity 0.3s;
179
+ white-space: nowrap;
180
  }
181
 
182
+ .concept:hover .concept-description {
183
+ opacity: 1;
184
+ }
185
+
186
+ .artifact {
187
+ position: absolute;
188
+ background: rgba(76, 175, 80, 0.1);
189
+ border-radius: 50%;
190
+ }
191
+
192
+ .artifact.large {
193
+ width: 300px;
194
+ height: 300px;
195
+ top: -50px;
196
+ left: -150px;
197
+ }
198
+
199
+ .artifact.medium {
200
+ width: 200px;
201
+ height: 200px;
202
+ bottom: -50px;
203
+ right: -100px;
204
+ }
205
+
206
+ .artifact.small {
207
+ width: 100px;
208
+ height: 100px;
209
+ top: 50%;
210
+ left: 50%;
211
+ transform: translate(-50%, -50%);
212
  }
213
 
214
  .input-box {
 
216
  padding: 10px;
217
  border-radius: 20px;
218
  border: none;
219
+ background-color: rgba(255, 255, 255, 0.8);
220
+ color: #333;
221
  margin-top: 20px;
222
  }
223
 
224
  .submit-btn {
225
+ background-color: #4CAF50;
226
  color: white;
227
  border: none;
228
  padding: 10px 20px;
 
233
  }
234
 
235
  .submit-btn:hover {
236
+ background-color: #45a049;
237
  }
238
  """
239
 
240
+ # Updated Custom HTML
241
  custom_html = """
242
+ <div id="indic-assistant">
243
+ <!-- Artifacts -->
244
+ <div class="artifact large"></div>
245
+ <div class="artifact medium"></div>
246
+ <div class="artifact small"></div>
247
+
248
+ <!-- Content -->
249
+ <h1>Indic Language Virtual Assistant</h1>
250
+ <p>Speak or type in any supported Indic language or English. The assistant will respond in text and audio.</p>
251
+
252
+ <div style="display: flex; justify-content: center; gap: 20px; margin-top: 20px;">
253
+ <div class="concept">
254
+ <img src="https://github.com/yourusername/yourrepo/assets/placeholder-audio-icon.png" alt="Audio Input">
255
+ <div class="concept-description">Speak in any Indic language</div>
256
+ </div>
257
+ <div class="concept">
258
+ <img src="https://github.com/yourusername/yourrepo/assets/placeholder-text-icon.png" alt="Text Input">
259
+ <div class="concept-description">Type in any Indic language</div>
260
  </div>
261
+ <div class="concept">
262
+ <img src="https://github.com/yourusername/yourrepo/assets/placeholder-response-icon.png" alt="AI Response">
263
+ <div class="concept-description">Get AI-generated responses</div>
264
  </div>
265
  </div>
266
  </div>
 
282
  title="Indic Language Virtual Assistant",
283
  description="Speak or type in any supported Indic language or English. The assistant will respond in text and audio.",
284
  css=custom_css,
285
+ article=custom_html,
286
+ theme="default" # Changed from "dark" to "default" to match the new light theme
287
  )
288
 
289
  # Launch the app