ginipick commited on
Commit
f4f87ac
·
verified ·
1 Parent(s): c853ff4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +72 -51
app.py CHANGED
@@ -192,53 +192,65 @@ def respond(message: str, chat_history: List[Dict[str, str]], max_tokens: int, t
192
 
193
  def create_ui():
194
  try:
195
- css = """
196
- footer {visibility: hidden;}
197
- .output-group {
198
- border: 1px solid #ddd;
199
- border-radius: 5px;
200
- padding: 10px;
201
- margin-bottom: 20px;
202
- }
203
- .scroll-lock {
204
- overflow-y: auto !important;
205
- max-height: calc((100vh - 200px) / 5) !important;
206
- }
207
- .tree-view-scroll {
208
- overflow-y: auto !important;
209
- max-height: calc((100vh - 200px) / 2) !important; /* 트리 뷰 높이 증가 */
210
- }
211
- .full-height {
212
- height: calc(100vh - 200px) !important;
213
- overflow-y: auto !important;
214
- }
215
- .tab-nav {
216
- background-color: #2c3e50;
217
- border-radius: 5px 5px 0 0;
218
- overflow: hidden;
219
- }
220
- .tab-nav button {
221
- color: #ecf0f1 !important;
222
- background-color: #34495e;
223
- border: none;
224
- padding: 10px 20px;
225
- margin: 0;
226
- transition: background-color 0.3s;
227
- font-size: 16px;
228
- font-weight: bold;
229
- }
230
- .tab-nav button:hover {
231
- background-color: #2980b9;
232
- }
233
- .tab-nav button.selected {
234
- color: #2c3e50 !important;
235
- background-color: #ecf0f1;
236
- }
237
- input[type="text"], textarea {
238
- color: #2c3e50 !important;
239
- background-color: #ecf0f1 !important;
240
- }
241
- """
 
 
 
 
 
 
 
 
 
 
 
 
242
 
243
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
244
  gr.Markdown("# Mouse: HuggingFace")
@@ -268,12 +280,21 @@ def create_ui():
268
  with code_tabs:
269
  app_py_tab = gr.TabItem("app.py")
270
  with app_py_tab:
271
- app_py_content = gr.Code(language="python", label="app.py", lines=30, elem_classes="full-height") # 스크롤 추가
 
 
 
 
 
272
  requirements_tab = gr.TabItem("requirements.txt")
273
  with requirements_tab:
274
- requirements_content = gr.Textbox(label="requirements.txt", lines=30, elem_classes="full-height") # 스크롤 추가
275
-
276
-
 
 
 
 
277
 
278
  with gr.TabItem("AI 코딩"):
279
  chatbot = gr.Chatbot(label="대화")
 
192
 
193
  def create_ui():
194
  try:
195
+ css = """
196
+ footer {visibility: hidden;}
197
+ .output-group {
198
+ border: 1px solid #ddd;
199
+ border-radius: 5px;
200
+ padding: 10px;
201
+ margin-bottom: 20px;
202
+ }
203
+ .scroll-lock {
204
+ overflow-y: auto !important;
205
+ max-height: calc((100vh - 200px) / 5) !important;
206
+ }
207
+ .tree-view-scroll {
208
+ overflow-y: auto !important;
209
+ max-height: calc((100vh - 200px) / 2) !important;
210
+ }
211
+ .full-height {
212
+ height: calc(100vh - 200px) !important;
213
+ overflow-y: auto !important;
214
+ }
215
+ .code-box {
216
+ overflow-x: auto !important;
217
+ white-space: pre !important;
218
+ word-wrap: normal !important;
219
+ }
220
+ .code-box > div {
221
+ min-width: 100% !important;
222
+ }
223
+ .code-box > div > textarea {
224
+ word-break: normal !important;
225
+ overflow-wrap: normal !important;
226
+ }
227
+ .tab-nav {
228
+ background-color: #2c3e50;
229
+ border-radius: 5px 5px 0 0;
230
+ overflow: hidden;
231
+ }
232
+ .tab-nav button {
233
+ color: #ecf0f1 !important;
234
+ background-color: #34495e;
235
+ border: none;
236
+ padding: 10px 20px;
237
+ margin: 0;
238
+ transition: background-color 0.3s;
239
+ font-size: 16px;
240
+ font-weight: bold;
241
+ }
242
+ .tab-nav button:hover {
243
+ background-color: #2980b9;
244
+ }
245
+ .tab-nav button.selected {
246
+ color: #2c3e50 !important;
247
+ background-color: #ecf0f1;
248
+ }
249
+ input[type="text"], textarea {
250
+ color: #2c3e50 !important;
251
+ background-color: #ecf0f1 !important;
252
+ }
253
+ """
254
 
255
  with gr.Blocks(theme="Nymbo/Nymbo_Theme", css=css) as demo:
256
  gr.Markdown("# Mouse: HuggingFace")
 
280
  with code_tabs:
281
  app_py_tab = gr.TabItem("app.py")
282
  with app_py_tab:
283
+ app_py_content = gr.Code(
284
+ language="python",
285
+ label="app.py",
286
+ lines=30,
287
+ elem_classes="full-height code-box"
288
+ )
289
  requirements_tab = gr.TabItem("requirements.txt")
290
  with requirements_tab:
291
+ requirements_content = gr.Code(
292
+ language="text",
293
+ label="requirements.txt",
294
+ lines=30,
295
+ elem_classes="full-height code-box"
296
+ )
297
+
298
 
299
  with gr.TabItem("AI 코딩"):
300
  chatbot = gr.Chatbot(label="대화")