Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -227,197 +227,13 @@ def generate(input_dict: dict, chat_history: list[dict],
|
|
227 |
yield final_response
|
228 |
|
229 |
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
font-family: 'GT-Maru';
|
236 |
-
src: url('/fonts/GT Maru/GT-Maru-Regular.otf') format('opentype');
|
237 |
-
font-weight: 400;
|
238 |
-
font-style: normal;
|
239 |
-
font-display: swap;
|
240 |
}
|
241 |
-
|
242 |
-
font-family: 'GT-Maru';
|
243 |
-
src: url('/fonts/GT Maru/GT-Maru-Regular-Oblique.otf') format('opentype');
|
244 |
-
font-weight: 400;
|
245 |
-
font-style: italic;
|
246 |
-
font-display: swap;
|
247 |
-
}
|
248 |
-
|
249 |
-
/* GT Maru Light */
|
250 |
-
@font-face {
|
251 |
-
font-family: 'GT-Maru';
|
252 |
-
src: url('/fonts/GT Maru/GT-Maru-Light.otf') format('opentype');
|
253 |
-
font-weight: 300;
|
254 |
-
font-style: normal;
|
255 |
-
font-display: swap;
|
256 |
-
}
|
257 |
-
@font-face {
|
258 |
-
font-family: 'GT-Maru';
|
259 |
-
src: url('/fonts/GT Maru/GT-Maru-Light-Oblique.otf') format('opentype');
|
260 |
-
font-weight: 300;
|
261 |
-
font-style: italic;
|
262 |
-
font-display: swap;
|
263 |
-
}
|
264 |
-
|
265 |
-
/* GT Maru Medium */
|
266 |
-
@font-face {
|
267 |
-
font-family: 'GT-Maru';
|
268 |
-
src: url('/fonts/GT Maru/GT-Maru-Medium.otf') format('opentype');
|
269 |
-
font-weight: 500;
|
270 |
-
font-style: normal;
|
271 |
-
font-display: swap;
|
272 |
-
}
|
273 |
-
@font-face {
|
274 |
-
font-family: 'GT-Maru';
|
275 |
-
src: url('/fonts/GT Maru/GT-Maru-Medium-Oblique.otf') format('opentype');
|
276 |
-
font-weight: 500;
|
277 |
-
font-style: italic;
|
278 |
-
font-display: swap;
|
279 |
-
}
|
280 |
-
|
281 |
-
/* GT Maru Bold */
|
282 |
-
@font-face {
|
283 |
-
font-family: 'GT-Maru';
|
284 |
-
src: url('/fonts/GT Maru/GT-Maru-Bold.otf') format('opentype');
|
285 |
-
font-weight: 700;
|
286 |
-
font-style: normal;
|
287 |
-
font-display: swap;
|
288 |
-
}
|
289 |
-
@font-face {
|
290 |
-
font-family: 'GT-Maru';
|
291 |
-
src: url('/fonts/GT Maru/GT-Maru-Bold-Oblique.otf') format('opentype');
|
292 |
-
font-weight: 700;
|
293 |
-
font-style: italic;
|
294 |
-
font-display: swap;
|
295 |
-
}
|
296 |
-
|
297 |
-
/* GT Maru Black */
|
298 |
-
@font-face {
|
299 |
-
font-family: 'GT-Maru';
|
300 |
-
src: url('/fonts/GT Maru/GT-Maru-Black.otf') format('opentype');
|
301 |
-
font-weight: 900;
|
302 |
-
font-style: normal;
|
303 |
-
font-display: swap;
|
304 |
-
}
|
305 |
-
@font-face {
|
306 |
-
font-family: 'GT-Maru';
|
307 |
-
src: url('/fonts/GT Maru/GT-Maru-Black-Oblique.otf') format('opentype');
|
308 |
-
font-weight: 900;
|
309 |
-
font-style: italic;
|
310 |
-
font-display: swap;
|
311 |
-
}
|
312 |
-
|
313 |
-
/* GT Maru Mono Regular */
|
314 |
-
@font-face {
|
315 |
-
font-family: 'GT-Maru-Mono';
|
316 |
-
src: url('/fonts/GT Maru/GT-Maru-Mono-Regular.otf') format('opentype');
|
317 |
-
font-weight: 400;
|
318 |
-
font-style: normal;
|
319 |
-
font-display: swap;
|
320 |
-
}
|
321 |
-
@font-face {
|
322 |
-
font-family: 'GT-Maru-Mono';
|
323 |
-
src: url('/fonts/GT Maru/GT-Maru-Mono-Regular-Oblique.otf') format('opentype');
|
324 |
-
font-weight: 400;
|
325 |
-
font-style: italic;
|
326 |
-
font-display: swap;
|
327 |
-
}
|
328 |
-
|
329 |
-
/* GT Maru Mono Medium */
|
330 |
-
@font-face {
|
331 |
-
font-family: 'GT-Maru-Mono';
|
332 |
-
src: url('/fonts/GT Maru/GT-Maru-Mono-Medium.otf') format('opentype');
|
333 |
-
font-weight: 500;
|
334 |
-
font-style: normal;
|
335 |
-
font-display: swap;
|
336 |
-
}
|
337 |
-
@font-face {
|
338 |
-
font-family: 'GT-Maru-Mono';
|
339 |
-
src: url('/fonts/GT Maru/GT-Maru-Mono-Medium-Oblique.otf') format('opentype');
|
340 |
-
font-weight: 500;
|
341 |
-
font-style: italic;
|
342 |
-
font-display: swap;
|
343 |
-
}
|
344 |
-
|
345 |
-
/* GT Maru Mega Midi (for special display text) */
|
346 |
-
@font-face {
|
347 |
-
font-family: 'GT-Maru-Mega-Midi';
|
348 |
-
src: url('/fonts/GT Maru/GT-Maru-Mega-Midi.otf') format('opentype');
|
349 |
-
font-weight: normal;
|
350 |
-
font-style: normal;
|
351 |
-
font-display: swap;
|
352 |
-
}
|
353 |
-
|
354 |
-
/* ------------------ END FONTS.CSS ------------------ */
|
355 |
-
/* ------------------ START GLOBAL.CSS ------------------ */
|
356 |
-
|
357 |
-
@import "tailwindcss";
|
358 |
-
|
359 |
-
:root {
|
360 |
-
--background: #ffffff;
|
361 |
-
--foreground: #171717;
|
362 |
-
--font-gt-maru: 'GT-Maru', sans-serif;
|
363 |
-
--font-gt-maru-mono: 'GT-Maru-Mono', monospace;
|
364 |
-
--font-gt-maru-mega: 'GT-Maru-Mega-Midi', sans-serif;
|
365 |
-
--notebook-bg: #f3f4f6; /* Tailwind gray-100 */
|
366 |
-
--notebook-dot: #d1d5db; /* Tailwind gray-300 for dots */
|
367 |
-
}
|
368 |
-
|
369 |
-
@theme inline {
|
370 |
-
--color-background: var(--background);
|
371 |
-
--color-foreground: var(--foreground);
|
372 |
-
--font-sans: var(--font-gt-maru);
|
373 |
-
--font-mono: var(--font-gt-maru-mono);
|
374 |
-
}
|
375 |
-
|
376 |
-
@media (prefers-color-scheme: dark) {
|
377 |
-
:root {
|
378 |
-
--background: #0a0a0a;
|
379 |
-
--foreground: #ededed;
|
380 |
-
}
|
381 |
-
}
|
382 |
-
|
383 |
-
body {
|
384 |
-
color: var(--foreground);
|
385 |
-
font-family: var(--font-gt-maru);
|
386 |
-
background-color: var(--notebook-bg);
|
387 |
-
background-image: radial-gradient(var(--notebook-dot) 1px, transparent 1px);
|
388 |
-
background-size: 24px 24px;
|
389 |
-
}
|
390 |
-
|
391 |
-
/* Container styling for paper effect */
|
392 |
-
.paper-container {
|
393 |
-
background-color: rgba(255, 255, 255, 0.7);
|
394 |
-
border-radius: 12px;
|
395 |
-
box-shadow:
|
396 |
-
0 2px 8px rgba(0, 0, 0, 0.05),
|
397 |
-
0 8px 20px rgba(0, 0, 0, 0.03);
|
398 |
-
backdrop-filter: blur(2px);
|
399 |
-
}
|
400 |
-
|
401 |
-
/* Notebook paper dotted background - now for specific elements only */
|
402 |
-
.notebook-paper-bg {
|
403 |
-
background-color: var(--notebook-bg);
|
404 |
-
background-image: radial-gradient(var(--notebook-dot) 1px, transparent 1px);
|
405 |
-
background-size: 24px 24px;
|
406 |
-
background-position: 0 0;
|
407 |
-
border-radius: 12px;
|
408 |
-
box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.03);
|
409 |
-
}
|
410 |
-
|
411 |
-
/* Shadow effect for paper depth */
|
412 |
-
.paper-shadow {
|
413 |
-
box-shadow:
|
414 |
-
0 1px 3px rgba(0, 0, 0, 0.05),
|
415 |
-
0 4px 6px rgba(0, 0, 0, 0.03),
|
416 |
-
inset 0 0 3px rgba(255, 255, 255, 0.8);
|
417 |
-
}
|
418 |
-
|
419 |
-
/* ------------------ END GLOBAL.CSS ------------------ */
|
420 |
-
"""
|
421 |
|
422 |
# Create the Gradio ChatInterface with the custom CSS applied
|
423 |
demo = gr.ChatInterface(
|
@@ -435,7 +251,7 @@ demo = gr.ChatInterface(
|
|
435 |
textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image", "video"], file_count="multiple"),
|
436 |
stop_btn="Stop Generation",
|
437 |
multimodal=True,
|
438 |
-
css=
|
439 |
)
|
440 |
|
441 |
if __name__ == "__main__":
|
|
|
227 |
yield final_response
|
228 |
|
229 |
|
230 |
+
css = '''
|
231 |
+
.gradio-container{max-width: 1000px !important}
|
232 |
+
h1{text-align:center}
|
233 |
+
footer {
|
234 |
+
visibility: hidden
|
|
|
|
|
|
|
|
|
|
|
235 |
}
|
236 |
+
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
|
238 |
# Create the Gradio ChatInterface with the custom CSS applied
|
239 |
demo = gr.ChatInterface(
|
|
|
251 |
textbox=gr.MultimodalTextbox(label="Query Input", file_types=["image", "video"], file_count="multiple"),
|
252 |
stop_btn="Stop Generation",
|
253 |
multimodal=True,
|
254 |
+
css=css
|
255 |
)
|
256 |
|
257 |
if __name__ == "__main__":
|