Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -75,7 +75,7 @@ def chat_response(user_input, history_pairs):
|
|
| 75 |
return r["choices"][0]["message"]["content"].strip()
|
| 76 |
|
| 77 |
# ------------------------------------------------------------------
|
| 78 |
-
# 4. CSS (스크롤바 중복 해결
|
| 79 |
# ------------------------------------------------------------------
|
| 80 |
PC_COM_CSS = r"""
|
| 81 |
@import url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-webfont@latest/neodgm/neodgm.css');
|
|
@@ -147,7 +147,15 @@ div[data-testid="bot"] {
|
|
| 147 |
border: none !important;
|
| 148 |
}
|
| 149 |
|
| 150 |
-
/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
.chatbot .user-row,
|
| 152 |
.chatbot .user,
|
| 153 |
div[data-testid="user"] {
|
|
@@ -156,7 +164,8 @@ div[data-testid="user"] {
|
|
| 156 |
justify-content: flex-end !important;
|
| 157 |
margin-left: auto !important;
|
| 158 |
background: transparent !important;
|
| 159 |
-
padding: 0 !important;
|
|
|
|
| 160 |
}
|
| 161 |
|
| 162 |
.chatbot .user-row .message,
|
|
@@ -176,6 +185,7 @@ div[data-testid="user"] .message {
|
|
| 176 |
div[data-testid="user"] p {
|
| 177 |
color: #FFFFFF !important;
|
| 178 |
text-align: right !important;
|
|
|
|
| 179 |
}
|
| 180 |
|
| 181 |
.chatbot .user-row .message::after,
|
|
@@ -187,7 +197,7 @@ div[data-testid="user"] p {
|
|
| 187 |
display: inline-block;
|
| 188 |
}
|
| 189 |
|
| 190 |
-
/* 3. 봇 메시지 (좌측 정렬 + 호박색) */
|
| 191 |
.chatbot .bot-row,
|
| 192 |
.chatbot .bot,
|
| 193 |
div[data-testid="bot"] {
|
|
@@ -195,7 +205,8 @@ div[data-testid="bot"] {
|
|
| 195 |
width: 100% !important;
|
| 196 |
justify-content: flex-start !important;
|
| 197 |
background: transparent !important;
|
| 198 |
-
padding: 0 !important;
|
|
|
|
| 199 |
}
|
| 200 |
|
| 201 |
.chatbot .bot-row .message,
|
|
@@ -213,6 +224,7 @@ div[data-testid="bot"] .message {
|
|
| 213 |
.chatbot .bot p,
|
| 214 |
div[data-testid="bot"] p {
|
| 215 |
color: var(--pc-amber) !important;
|
|
|
|
| 216 |
}
|
| 217 |
|
| 218 |
.chatbot .bot-row .message::before,
|
|
@@ -327,7 +339,7 @@ footer { display: none !important; }
|
|
| 327 |
# 5. App (로직 동일)
|
| 328 |
# ------------------------------------------------------------------
|
| 329 |
with gr.Blocks(theme=gr.themes.Base(), css=PC_COM_CSS, title="CHOLLIAN 98") as demo:
|
| 330 |
-
gr.Markdown("# ≪
|
| 331 |
gr.Markdown(">> 01410 접속 성공... [대화실]에 입장하셨습니다.")
|
| 332 |
|
| 333 |
history_state = gr.State([])
|
|
@@ -397,4 +409,5 @@ with gr.Blocks(theme=gr.themes.Base(), css=PC_COM_CSS, title="CHOLLIAN 98") as d
|
|
| 397 |
)
|
| 398 |
|
| 399 |
if __name__ == "__main__":
|
| 400 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
| 75 |
return r["choices"][0]["message"]["content"].strip()
|
| 76 |
|
| 77 |
# ------------------------------------------------------------------
|
| 78 |
+
# 4. CSS (스크롤바 중복 해결 + 메시지 간격 축소)
|
| 79 |
# ------------------------------------------------------------------
|
| 80 |
PC_COM_CSS = r"""
|
| 81 |
@import url('https://cdn.jsdelivr.net/gh/neodgm/neodgm-webfont@latest/neodgm/neodgm.css');
|
|
|
|
| 147 |
border: none !important;
|
| 148 |
}
|
| 149 |
|
| 150 |
+
/* [추가] 메시지 행 간격 줄이기 */
|
| 151 |
+
.chatbot .message-row,
|
| 152 |
+
.chatbot .row {
|
| 153 |
+
margin: 0 !important;
|
| 154 |
+
padding: 0 !important;
|
| 155 |
+
gap: 0 !important;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
/* 2. 유저 메시지 (우측 정렬 + 흰색 + 간격 축소) */
|
| 159 |
.chatbot .user-row,
|
| 160 |
.chatbot .user,
|
| 161 |
div[data-testid="user"] {
|
|
|
|
| 164 |
justify-content: flex-end !important;
|
| 165 |
margin-left: auto !important;
|
| 166 |
background: transparent !important;
|
| 167 |
+
padding: 2px 0 !important; /* 위아래 간격을 최소화 */
|
| 168 |
+
margin-bottom: 0 !important;
|
| 169 |
}
|
| 170 |
|
| 171 |
.chatbot .user-row .message,
|
|
|
|
| 185 |
div[data-testid="user"] p {
|
| 186 |
color: #FFFFFF !important;
|
| 187 |
text-align: right !important;
|
| 188 |
+
margin: 0 !important; /* p태그 자체 마진 제거 */
|
| 189 |
}
|
| 190 |
|
| 191 |
.chatbot .user-row .message::after,
|
|
|
|
| 197 |
display: inline-block;
|
| 198 |
}
|
| 199 |
|
| 200 |
+
/* 3. 봇 메시지 (좌측 정렬 + 호박색 + 간격 축소) */
|
| 201 |
.chatbot .bot-row,
|
| 202 |
.chatbot .bot,
|
| 203 |
div[data-testid="bot"] {
|
|
|
|
| 205 |
width: 100% !important;
|
| 206 |
justify-content: flex-start !important;
|
| 207 |
background: transparent !important;
|
| 208 |
+
padding: 2px 0 !important; /* 위아래 간격을 최소화 */
|
| 209 |
+
margin-bottom: 0 !important;
|
| 210 |
}
|
| 211 |
|
| 212 |
.chatbot .bot-row .message,
|
|
|
|
| 224 |
.chatbot .bot p,
|
| 225 |
div[data-testid="bot"] p {
|
| 226 |
color: var(--pc-amber) !important;
|
| 227 |
+
margin: 0 !important; /* p태그 자체 마진 제거 */
|
| 228 |
}
|
| 229 |
|
| 230 |
.chatbot .bot-row .message::before,
|
|
|
|
| 339 |
# 5. App (로직 동일)
|
| 340 |
# ------------------------------------------------------------------
|
| 341 |
with gr.Blocks(theme=gr.themes.Base(), css=PC_COM_CSS, title="CHOLLIAN 98") as demo:
|
| 342 |
+
gr.Markdown("# ≪ 십 리 안 ≫")
|
| 343 |
gr.Markdown(">> 01410 접속 성공... [대화실]에 입장하셨습니다.")
|
| 344 |
|
| 345 |
history_state = gr.State([])
|
|
|
|
| 409 |
)
|
| 410 |
|
| 411 |
if __name__ == "__main__":
|
| 412 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 413 |
+
|