Spaces:
Sleeping
Sleeping
no css
Browse files
app.py
CHANGED
|
@@ -6,112 +6,6 @@ from sentence_transformers import SentenceTransformer
|
|
| 6 |
import torch
|
| 7 |
import numpy as np
|
| 8 |
|
| 9 |
-
|
| 10 |
-
# === CSS CODE ===
|
| 11 |
-
css_code = """
|
| 12 |
-
@import url('https://fonts.googleapis.com/css2?family=Questrial&display=swap');
|
| 13 |
-
|
| 14 |
-
.gradio-container {
|
| 15 |
-
font-family: 'Questrial';
|
| 16 |
-
background-color: #e0dfd8 !important;
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
.about-text {
|
| 20 |
-
font-family: 'Questrial';
|
| 21 |
-
}
|
| 22 |
-
|
| 23 |
-
/* === IMAGE THEMING === */
|
| 24 |
-
.theme-image-container {
|
| 25 |
-
padding: 0;
|
| 26 |
-
margin: 0;
|
| 27 |
-
background: transparent;
|
| 28 |
-
text-align: center;
|
| 29 |
-
}
|
| 30 |
-
|
| 31 |
-
.theme-img {
|
| 32 |
-
display: none;
|
| 33 |
-
max-height: 160px;
|
| 34 |
-
margin: 0 auto;
|
| 35 |
-
background: transparent;
|
| 36 |
-
box-shadow: none;
|
| 37 |
-
border: none;
|
| 38 |
-
padding: 0;
|
| 39 |
-
}
|
| 40 |
-
|
| 41 |
-
.light-mode-img {
|
| 42 |
-
display: block;
|
| 43 |
-
}
|
| 44 |
-
.dark-mode-img {
|
| 45 |
-
display: none;
|
| 46 |
-
}
|
| 47 |
-
|
| 48 |
-
@media (prefers-color-scheme: dark) {
|
| 49 |
-
.light-mode-img {
|
| 50 |
-
display: none;
|
| 51 |
-
}
|
| 52 |
-
.dark-mode-img {
|
| 53 |
-
display: block;
|
| 54 |
-
}
|
| 55 |
-
}
|
| 56 |
-
|
| 57 |
-
/* === LIGHT MODE === */
|
| 58 |
-
@media (prefers-color-scheme: light) {
|
| 59 |
-
.about-text {
|
| 60 |
-
color: #000000;
|
| 61 |
-
}
|
| 62 |
-
|
| 63 |
-
.message.user {
|
| 64 |
-
background-color: #ffffff !important;
|
| 65 |
-
color: #333333 !important;
|
| 66 |
-
border-radius: 12px !important;
|
| 67 |
-
padding: 8px 12px !important;
|
| 68 |
-
}
|
| 69 |
-
|
| 70 |
-
.message.bot {
|
| 71 |
-
background-color: #d6f5d6 !important;
|
| 72 |
-
color: #1e4d1e !important;
|
| 73 |
-
border-radius: 12px !important;
|
| 74 |
-
padding: 8px 12px !important;
|
| 75 |
-
}
|
| 76 |
-
}
|
| 77 |
-
|
| 78 |
-
/* === DARK MODE === */
|
| 79 |
-
@media (prefers-color-scheme: dark) {
|
| 80 |
-
.about-text {
|
| 81 |
-
color: #ffffff;
|
| 82 |
-
}
|
| 83 |
-
|
| 84 |
-
body, html, .gradio-container, #root, .main {
|
| 85 |
-
background-color: #18181b !imporant;
|
| 86 |
-
color: #ffffff !important;
|
| 87 |
-
}
|
| 88 |
-
|
| 89 |
-
.message.user {
|
| 90 |
-
color: #dddddd !important;
|
| 91 |
-
}
|
| 92 |
-
|
| 93 |
-
.message.bot {
|
| 94 |
-
color: #9de09d !important;
|
| 95 |
-
}
|
| 96 |
-
}
|
| 97 |
-
|
| 98 |
-
/* === GRADIO IMAGE TWEAKS === */
|
| 99 |
-
.gr-image .absolute.top-0.right-0 {
|
| 100 |
-
display: none !important; /* removes fullscreen/download/share icons */
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
-
.gr-image .gbox {
|
| 104 |
-
display: none !important;
|
| 105 |
-
}
|
| 106 |
-
|
| 107 |
-
.gr-image {
|
| 108 |
-
pointer-events: none;
|
| 109 |
-
background: transparent !important;
|
| 110 |
-
box-shadow: none !important;
|
| 111 |
-
}
|
| 112 |
-
|
| 113 |
-
"""
|
| 114 |
-
|
| 115 |
# 7/30/25 NEW CODE FROM MINI LESSON
|
| 116 |
with open("knowledge.txt", "r", encoding="utf-8") as f:
|
| 117 |
knowledge_text = f.read()
|
|
|
|
| 6 |
import torch
|
| 7 |
import numpy as np
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# 7/30/25 NEW CODE FROM MINI LESSON
|
| 10 |
with open("knowledge.txt", "r", encoding="utf-8") as f:
|
| 11 |
knowledge_text = f.read()
|