sagar007 commited on
Commit
a703b55
·
verified ·
1 Parent(s): 36d40ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -84
app.py CHANGED
@@ -129,33 +129,31 @@ def indic_language_assistant(input_type, audio_input, text_input):
129
 
130
 
131
 
132
- # Updated Custom CSS
133
  custom_css = """
134
  body {
135
- background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
136
- font-family: Arial, sans-serif;
137
  }
138
 
139
  #indic-assistant {
140
- text-align: center;
141
- background: rgba(255, 255, 255, 0.8);
142
  padding: 20px;
143
  border-radius: 10px;
144
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
145
- position: relative;
146
  }
147
 
148
  #indic-assistant h1 {
149
- color: #4CAF50;
150
  font-size: 2em;
151
  margin-bottom: 10px;
152
  }
153
 
154
  .concept {
155
- position: relative;
156
- transition: transform 0.3s;
157
  display: inline-block;
158
  margin: 0 10px;
 
159
  }
160
 
161
  .concept:hover {
@@ -163,106 +161,52 @@ body {
163
  }
164
 
165
  .concept img {
166
- width: 100px;
 
167
  border-radius: 10px;
168
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
 
169
  }
170
 
171
  .concept-description {
172
- position: absolute;
173
- bottom: -30px;
174
- left: 50%;
175
- transform: translateX(-50%);
176
- background-color: #4CAF50;
177
- color: white;
178
- padding: 5px 10px;
179
- border-radius: 5px;
180
- opacity: 0;
181
- transition: opacity 0.3s;
182
- white-space: nowrap;
183
- }
184
-
185
- .concept:hover .concept-description {
186
- opacity: 1;
187
- }
188
-
189
- .artifact {
190
- position: absolute;
191
- background: rgba(76, 175, 80, 0.1);
192
- border-radius: 50%;
193
  }
194
 
195
- .artifact.large {
196
- width: 300px;
197
- height: 300px;
198
- top: -50px;
199
- left: -150px;
200
- }
201
-
202
- .artifact.medium {
203
- width: 200px;
204
- height: 200px;
205
- bottom: -50px;
206
- right: -100px;
207
- }
208
-
209
- .artifact.small {
210
- width: 100px;
211
- height: 100px;
212
- top: 50%;
213
- left: 50%;
214
- transform: translate(-50%, -50%);
215
- }
216
-
217
- .input-box {
218
- width: 100%;
219
- padding: 10px;
220
- border-radius: 20px;
221
- border: none;
222
- background-color: rgba(255, 255, 255, 0.8);
223
- color: #333;
224
- margin-top: 20px;
225
  }
226
 
227
  .submit-btn {
228
- background-color: #4CAF50;
229
- color: white;
230
- border: none;
231
- padding: 10px 20px;
232
- border-radius: 20px;
233
- cursor: pointer;
234
- margin-top: 10px;
235
- transition: background-color 0.3s ease;
236
  }
237
 
238
  .submit-btn:hover {
239
- background-color: #45a049;
240
  }
241
  """
242
 
243
  # Updated Custom HTML
244
  custom_html = """
245
  <div id="indic-assistant">
246
- <!-- Artifacts -->
247
- <div class="artifact large"></div>
248
- <div class="artifact medium"></div>
249
- <div class="artifact small"></div>
250
-
251
- <!-- Content -->
252
  <h1>Indic Language Virtual Assistant</h1>
253
  <p>Speak or type in any supported Indic language or English. The assistant will respond in text and audio.</p>
254
 
255
  <div style="display: flex; justify-content: center; gap: 20px; margin-top: 20px;">
256
  <div class="concept">
257
- <img src="https://github.com/yourusername/yourrepo/assets/placeholder-audio-icon.png" alt="Audio Input">
258
  <div class="concept-description">Speak in any Indic language</div>
259
  </div>
260
  <div class="concept">
261
- <img src="https://github.com/yourusername/yourrepo/assets/placeholder-text-icon.png" alt="Text Input">
262
  <div class="concept-description">Type in any Indic language</div>
263
  </div>
264
  <div class="concept">
265
- <img src="https://github.com/yourusername/yourrepo/assets/placeholder-response-icon.png" alt="AI Response">
266
  <div class="concept-description">Get AI-generated responses</div>
267
  </div>
268
  </div>
@@ -278,16 +222,16 @@ iface = gr.Interface(
278
  gr.Textbox(label="Type your message (if text input selected)", elem_classes="input-box")
279
  ],
280
  outputs=[
281
- gr.Textbox(label="Transcription/Input"),
282
- gr.Textbox(label="Generated Response"),
283
  gr.Audio(label="Audio Response")
284
  ],
285
  title="Indic Language Virtual Assistant",
286
  description="Speak or type in any supported Indic language or English. The assistant will respond in text and audio.",
287
  css=custom_css,
288
  article=custom_html,
289
- theme="default" # Changed from "dark" to "default" to match the new light theme
290
  )
291
 
292
  # Launch the app
293
- iface.launch()
 
129
 
130
 
131
 
132
+ # Updated Custom CSS for dark theme
133
  custom_css = """
134
  body {
135
+ background-color: #0b0f19;
136
+ color: #ffffff;
137
  }
138
 
139
  #indic-assistant {
140
+ background: rgba(255, 255, 255, 0.05);
 
141
  padding: 20px;
142
  border-radius: 10px;
143
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
144
+ margin-bottom: 20px;
145
  }
146
 
147
  #indic-assistant h1 {
148
+ color: #ff6b6b;
149
  font-size: 2em;
150
  margin-bottom: 10px;
151
  }
152
 
153
  .concept {
 
 
154
  display: inline-block;
155
  margin: 0 10px;
156
+ transition: transform 0.3s;
157
  }
158
 
159
  .concept:hover {
 
161
  }
162
 
163
  .concept img {
164
+ width: 50px;
165
+ height: 50px;
166
  border-radius: 10px;
167
+ background-color: #2c3e50;
168
+ padding: 10px;
169
  }
170
 
171
  .concept-description {
172
+ color: #bdc3c7;
173
+ margin-top: 5px;
174
+ font-size: 0.9em;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  }
176
 
177
+ .input-box, .output-box {
178
+ background-color: #1e2a38 !important;
179
+ border: 1px solid #34495e !important;
180
+ color: #ecf0f1 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  }
182
 
183
  .submit-btn {
184
+ background-color: #ff6b6b !important;
185
+ color: white !important;
 
 
 
 
 
 
186
  }
187
 
188
  .submit-btn:hover {
189
+ background-color: #ff8787 !important;
190
  }
191
  """
192
 
193
  # Updated Custom HTML
194
  custom_html = """
195
  <div id="indic-assistant">
 
 
 
 
 
 
196
  <h1>Indic Language Virtual Assistant</h1>
197
  <p>Speak or type in any supported Indic language or English. The assistant will respond in text and audio.</p>
198
 
199
  <div style="display: flex; justify-content: center; gap: 20px; margin-top: 20px;">
200
  <div class="concept">
201
+ <img src="https://img.icons8.com/nolan/64/microphone.png" alt="Audio Input">
202
  <div class="concept-description">Speak in any Indic language</div>
203
  </div>
204
  <div class="concept">
205
+ <img src="https://img.icons8.com/nolan/64/keyboard.png" alt="Text Input">
206
  <div class="concept-description">Type in any Indic language</div>
207
  </div>
208
  <div class="concept">
209
+ <img src="https://img.icons8.com/nolan/64/artificial-intelligence.png" alt="AI Response">
210
  <div class="concept-description">Get AI-generated responses</div>
211
  </div>
212
  </div>
 
222
  gr.Textbox(label="Type your message (if text input selected)", elem_classes="input-box")
223
  ],
224
  outputs=[
225
+ gr.Textbox(label="Transcription/Input", elem_classes="output-box"),
226
+ gr.Textbox(label="Generated Response", elem_classes="output-box"),
227
  gr.Audio(label="Audio Response")
228
  ],
229
  title="Indic Language Virtual Assistant",
230
  description="Speak or type in any supported Indic language or English. The assistant will respond in text and audio.",
231
  css=custom_css,
232
  article=custom_html,
233
+ theme="dark"
234
  )
235
 
236
  # Launch the app
237
+ iface.launch()