Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,7 +78,7 @@ def chat_response(user_input, history_pairs):
|
|
| 78 |
return r["choices"][0]["message"]["content"].strip()
|
| 79 |
|
| 80 |
# ------------------------------------------------------------------
|
| 81 |
-
# 4. CSS (강력한 선택자로 재작성)
|
| 82 |
# ------------------------------------------------------------------
|
| 83 |
PC_COM_CSS = r"""
|
| 84 |
@import url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-webfont@latest/neodgm/neodgm.css');
|
|
@@ -113,6 +113,14 @@ h1 {
|
|
| 113 |
h1::before { content: "☎ "; }
|
| 114 |
h1::after { content: " ☎"; }
|
| 115 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
/* 챗봇 컨테이너 */
|
| 117 |
.chatbot {
|
| 118 |
background-color: var(--pc-blue) !important;
|
|
@@ -122,95 +130,128 @@ h1::after { content: " ☎"; }
|
|
| 122 |
}
|
| 123 |
|
| 124 |
/* =================================================================
|
| 125 |
-
[강제 스타일 적용 구간]
|
| 126 |
-
|
| 127 |
================================================================= */
|
| 128 |
|
| 129 |
-
/* 1.
|
| 130 |
-
.chatbot .message
|
| 131 |
-
.chatbot .message,
|
| 132 |
-
.chatbot
|
|
|
|
|
|
|
| 133 |
background: transparent !important;
|
| 134 |
-
border: none !important;
|
| 135 |
box-shadow: none !important;
|
| 136 |
-
|
| 137 |
}
|
| 138 |
|
| 139 |
-
/* 2. 유저 메시지 (
|
| 140 |
-
.
|
|
|
|
|
|
|
|
|
|
| 141 |
display: flex !important;
|
| 142 |
-
justify-content: flex-end !important; /* 플렉스 우측 정렬 */
|
| 143 |
width: 100% !important;
|
| 144 |
-
|
|
|
|
|
|
|
|
|
|
| 145 |
}
|
| 146 |
|
| 147 |
-
/* 유저 말풍선
|
| 148 |
-
.chatbot .user-row .message
|
| 149 |
-
|
|
|
|
| 150 |
text-align: right !important;
|
| 151 |
-
|
|
|
|
|
|
|
| 152 |
border: none !important;
|
|
|
|
|
|
|
| 153 |
}
|
| 154 |
|
| 155 |
-
/* 유저 텍스트
|
| 156 |
-
.chatbot .user-row
|
| 157 |
-
.chatbot .user
|
| 158 |
-
|
| 159 |
color: #FFFFFF !important;
|
|
|
|
| 160 |
}
|
| 161 |
|
| 162 |
/* 유저 접두사 처리 */
|
| 163 |
-
.chatbot .user-row .message::after
|
|
|
|
| 164 |
content: " < 나";
|
| 165 |
color: var(--pc-grey);
|
| 166 |
margin-left: 5px;
|
| 167 |
font-size: 16px;
|
|
|
|
| 168 |
}
|
| 169 |
|
| 170 |
-
/* 3. 봇 메시지 (
|
| 171 |
-
.chatbot .bot-row
|
|
|
|
|
|
|
| 172 |
display: flex !important;
|
| 173 |
-
justify-content: flex-start !important;
|
| 174 |
width: 100% !important;
|
| 175 |
-
|
|
|
|
|
|
|
| 176 |
}
|
| 177 |
|
| 178 |
-
/* 봇 말풍선
|
| 179 |
-
.chatbot .bot-row .message
|
| 180 |
-
|
|
|
|
| 181 |
text-align: left !important;
|
| 182 |
-
|
|
|
|
|
|
|
| 183 |
border: none !important;
|
|
|
|
| 184 |
}
|
| 185 |
|
| 186 |
-
/* 봇 텍스트
|
| 187 |
-
.chatbot .bot-row
|
| 188 |
-
.chatbot .bot
|
| 189 |
-
|
| 190 |
color: var(--pc-amber) !important;
|
| 191 |
}
|
| 192 |
|
| 193 |
/* 봇 접두사 처리 */
|
| 194 |
-
.chatbot .bot-row .message::before
|
|
|
|
| 195 |
content: "똘배 > ";
|
| 196 |
color: var(--pc-cyan);
|
| 197 |
margin-right: 5px;
|
| 198 |
font-size: 16px;
|
|
|
|
| 199 |
}
|
| 200 |
|
| 201 |
-
/* 4.
|
| 202 |
-
|
| 203 |
-
|
| 204 |
-
|
| 205 |
-
/* 5. 로딩(초시계) ���타일 수정 */
|
| 206 |
-
/* 로딩 컨테이너 배경 날리기 */
|
| 207 |
.chatbot .pending,
|
| 208 |
-
.chatbot .generating
|
|
|
|
|
|
|
|
|
|
| 209 |
background: transparent !important;
|
| 210 |
border: none !important;
|
| 211 |
box-shadow: none !important;
|
| 212 |
}
|
| 213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
/* 로딩 텍스트(초) 하얗게 */
|
| 215 |
.chatbot .pending span,
|
| 216 |
.chatbot .generating span,
|
|
@@ -218,14 +259,19 @@ span.progress-text {
|
|
| 218 |
color: #FFFFFF !important;
|
| 219 |
background: transparent !important;
|
| 220 |
font-family: 'NeoDunggeunmo', monospace !important;
|
|
|
|
| 221 |
}
|
| 222 |
|
| 223 |
-
/*
|
| 224 |
.chatbot .load-wrap,
|
| 225 |
-
.chatbot .loading-indicator
|
|
|
|
| 226 |
display: none !important;
|
| 227 |
}
|
| 228 |
|
|
|
|
|
|
|
|
|
|
| 229 |
/* ================================================================= */
|
| 230 |
|
| 231 |
.input-container {
|
|
@@ -361,4 +407,5 @@ with gr.Blocks(theme=gr.themes.Base(), css=PC_COM_CSS, title="CHOLLIAN 98") as d
|
|
| 361 |
)
|
| 362 |
|
| 363 |
if __name__ == "__main__":
|
| 364 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
| 78 |
return r["choices"][0]["message"]["content"].strip()
|
| 79 |
|
| 80 |
# ------------------------------------------------------------------
|
| 81 |
+
# 4. CSS (강력한 선택자로 재작성 - 진짜 해결 버전)
|
| 82 |
# ------------------------------------------------------------------
|
| 83 |
PC_COM_CSS = r"""
|
| 84 |
@import url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-webfont@latest/neodgm/neodgm.css');
|
|
|
|
| 113 |
h1::before { content: "☎ "; }
|
| 114 |
h1::after { content: " ☎"; }
|
| 115 |
|
| 116 |
+
/* 설명 텍스트 (접속 메시지) - 호박색으로 변경 */
|
| 117 |
+
.gradio-container p {
|
| 118 |
+
color: var(--pc-amber) !important;
|
| 119 |
+
font-size: 18px !important;
|
| 120 |
+
border-bottom: 1px dashed var(--pc-grey);
|
| 121 |
+
padding-bottom: 5px;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
/* 챗봇 컨테이너 */
|
| 125 |
.chatbot {
|
| 126 |
background-color: var(--pc-blue) !important;
|
|
|
|
| 130 |
}
|
| 131 |
|
| 132 |
/* =================================================================
|
| 133 |
+
[강제 스타일 적용 구간 - v2]
|
| 134 |
+
더욱 구체적인 선택자로 그라디오 기본 스타일을 덮어씀
|
| 135 |
================================================================= */
|
| 136 |
|
| 137 |
+
/* 1. 기본 메시지 초기화 */
|
| 138 |
+
.chatbot .message,
|
| 139 |
+
.chatbot .message-wrap,
|
| 140 |
+
.chatbot .message-row,
|
| 141 |
+
div[data-testid="user"],
|
| 142 |
+
div[data-testid="bot"] {
|
| 143 |
background: transparent !important;
|
|
|
|
| 144 |
box-shadow: none !important;
|
| 145 |
+
border: none !important;
|
| 146 |
}
|
| 147 |
|
| 148 |
+
/* 2. 유저 메시지 (우측 정렬 해결) */
|
| 149 |
+
/* .user, .user-row, data-testid="user" 모두 타겟팅 */
|
| 150 |
+
.chatbot .user-row,
|
| 151 |
+
.chatbot .user,
|
| 152 |
+
div[data-testid="user"] {
|
| 153 |
display: flex !important;
|
|
|
|
| 154 |
width: 100% !important;
|
| 155 |
+
justify-content: flex-end !important; /* 플렉스 우측 정렬 */
|
| 156 |
+
margin-left: auto !important;
|
| 157 |
+
background: transparent !important;
|
| 158 |
+
padding: 0 !important;
|
| 159 |
}
|
| 160 |
|
| 161 |
+
/* 유저 말풍선 텍스트 */
|
| 162 |
+
.chatbot .user-row .message,
|
| 163 |
+
.chatbot .user .message,
|
| 164 |
+
div[data-testid="user"] .message {
|
| 165 |
text-align: right !important;
|
| 166 |
+
color: #FFFFFF !important;
|
| 167 |
+
background: transparent !important;
|
| 168 |
+
padding: 5px 10px !important;
|
| 169 |
border: none !important;
|
| 170 |
+
width: auto !important;
|
| 171 |
+
max-width: 80% !important; /* 너무 길어지지 않게 */
|
| 172 |
}
|
| 173 |
|
| 174 |
+
/* 유저 텍스트 강제 흰색 */
|
| 175 |
+
.chatbot .user-row p,
|
| 176 |
+
.chatbot .user p,
|
| 177 |
+
div[data-testid="user"] p {
|
| 178 |
color: #FFFFFF !important;
|
| 179 |
+
text-align: right !important;
|
| 180 |
}
|
| 181 |
|
| 182 |
/* 유저 접두사 처리 */
|
| 183 |
+
.chatbot .user-row .message::after,
|
| 184 |
+
.chatbot .user .message::after {
|
| 185 |
content: " < 나";
|
| 186 |
color: var(--pc-grey);
|
| 187 |
margin-left: 5px;
|
| 188 |
font-size: 16px;
|
| 189 |
+
display: inline-block;
|
| 190 |
}
|
| 191 |
|
| 192 |
+
/* 3. 봇 메시지 (좌측 정렬 + 호박색) */
|
| 193 |
+
.chatbot .bot-row,
|
| 194 |
+
.chatbot .bot,
|
| 195 |
+
div[data-testid="bot"] {
|
| 196 |
display: flex !important;
|
|
|
|
| 197 |
width: 100% !important;
|
| 198 |
+
justify-content: flex-start !important;
|
| 199 |
+
background: transparent !important;
|
| 200 |
+
padding: 0 !important;
|
| 201 |
}
|
| 202 |
|
| 203 |
+
/* 봇 말풍선 텍스트 */
|
| 204 |
+
.chatbot .bot-row .message,
|
| 205 |
+
.chatbot .bot .message,
|
| 206 |
+
div[data-testid="bot"] .message {
|
| 207 |
text-align: left !important;
|
| 208 |
+
color: var(--pc-amber) !important;
|
| 209 |
+
background: transparent !important;
|
| 210 |
+
padding: 5px 10px !important;
|
| 211 |
border: none !important;
|
| 212 |
+
width: auto !important;
|
| 213 |
}
|
| 214 |
|
| 215 |
+
/* 봇 텍스트 강제 호박색 */
|
| 216 |
+
.chatbot .bot-row p,
|
| 217 |
+
.chatbot .bot p,
|
| 218 |
+
div[data-testid="bot"] p {
|
| 219 |
color: var(--pc-amber) !important;
|
| 220 |
}
|
| 221 |
|
| 222 |
/* 봇 접두사 처리 */
|
| 223 |
+
.chatbot .bot-row .message::before,
|
| 224 |
+
.chatbot .bot .message::before {
|
| 225 |
content: "똘배 > ";
|
| 226 |
color: var(--pc-cyan);
|
| 227 |
margin-right: 5px;
|
| 228 |
font-size: 16px;
|
| 229 |
+
display: inline-block;
|
| 230 |
}
|
| 231 |
|
| 232 |
+
/* 4. 로딩(초시계) 하얀 배경 진짜 날리기 */
|
| 233 |
+
/* 로딩 관련 모든 컨테이너 타겟팅 */
|
|
|
|
|
|
|
|
|
|
|
|
|
| 234 |
.chatbot .pending,
|
| 235 |
+
.chatbot .generating,
|
| 236 |
+
.chatbot .message.pending,
|
| 237 |
+
.chatbot .message.generating,
|
| 238 |
+
.chatbot .wrap.default.full {
|
| 239 |
background: transparent !important;
|
| 240 |
border: none !important;
|
| 241 |
box-shadow: none !important;
|
| 242 |
}
|
| 243 |
|
| 244 |
+
/* 로딩 내부의 테이블 구조 배경 제거 (그라디오 일부 버전 대응) */
|
| 245 |
+
.chatbot .pending table,
|
| 246 |
+
.chatbot .pending tr,
|
| 247 |
+
.chatbot .pending td,
|
| 248 |
+
.chatbot .generating table,
|
| 249 |
+
.chatbot .generating tr,
|
| 250 |
+
.chatbot .generating td {
|
| 251 |
+
background: transparent !important;
|
| 252 |
+
border: none !important;
|
| 253 |
+
}
|
| 254 |
+
|
| 255 |
/* 로딩 텍스트(초) 하얗게 */
|
| 256 |
.chatbot .pending span,
|
| 257 |
.chatbot .generating span,
|
|
|
|
| 259 |
color: #FFFFFF !important;
|
| 260 |
background: transparent !important;
|
| 261 |
font-family: 'NeoDunggeunmo', monospace !important;
|
| 262 |
+
font-size: 16px !important;
|
| 263 |
}
|
| 264 |
|
| 265 |
+
/* 로딩바 애니메이션 숨기기 */
|
| 266 |
.chatbot .load-wrap,
|
| 267 |
+
.chatbot .loading-indicator,
|
| 268 |
+
.chatbot .meta-text {
|
| 269 |
display: none !important;
|
| 270 |
}
|
| 271 |
|
| 272 |
+
/* 아바타 숨김 */
|
| 273 |
+
.avatar { display: none !important; }
|
| 274 |
+
|
| 275 |
/* ================================================================= */
|
| 276 |
|
| 277 |
.input-container {
|
|
|
|
| 407 |
)
|
| 408 |
|
| 409 |
if __name__ == "__main__":
|
| 410 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 411 |
+
|