AnatoliiG commited on
Commit
6717428
·
1 Parent(s): 4a443a6

Update ui.py

Browse files
Files changed (1) hide show
  1. ui.py +7 -7
ui.py CHANGED
@@ -7,7 +7,6 @@ from model import engine
7
  from utils import sanitize_content
8
 
9
  # --- CSS стили ---
10
- # Обновляем CSS для максимального использования пространства
11
  CUSTOM_CSS = """
12
  .gradio-container {
13
  width: 100% !important;
@@ -15,15 +14,17 @@ CUSTOM_CSS = """
15
  max_width: 100% !important;
16
  margin: 0 !important;
17
  padding: 0 !important;
 
 
18
  }
19
  #chatbot {
20
- height: 85vh !important; /* Занимаем 85% высоты экрана */
21
- min-height: 85vh !important;
22
  flex-grow: 1;
23
  overflow: auto;
24
  font-family: 'Consolas', 'Monaco', monospace;
25
  }
26
- footer { visibility: hidden; } /* Скрываем футер gradio для экономии места */
27
  """
28
 
29
  # --- Логика событий ---
@@ -122,15 +123,14 @@ def create_ui():
122
  )
123
  clear_btn = gr.Button("🗑️ Clear Chat", variant="secondary")
124
 
125
- # Основная колонка чата
126
  with gr.Column(scale=1):
127
  chatbot = gr.Chatbot(
128
  label="Code Assistant",
129
  elem_id="chatbot",
130
  avatar_images=(None, "https://api.iconify.design/noto:robot.svg"),
131
- # show_copy_button=True удалено, так как вызывает ошибку в текущей версии
132
  scale=1,
133
- bubble_full_width=False,
134
  )
135
 
136
  with gr.Row(variant="compact"):
 
7
  from utils import sanitize_content
8
 
9
  # --- CSS стили ---
 
10
  CUSTOM_CSS = """
11
  .gradio-container {
12
  width: 100% !important;
 
14
  max_width: 100% !important;
15
  margin: 0 !important;
16
  padding: 0 !important;
17
+ display: flex;
18
+ flex-direction: column;
19
  }
20
  #chatbot {
21
+ height: 80vh !important;
22
+ min-height: 500px !important;
23
  flex-grow: 1;
24
  overflow: auto;
25
  font-family: 'Consolas', 'Monaco', monospace;
26
  }
27
+ footer { visibility: hidden !important; }
28
  """
29
 
30
  # --- Логика событий ---
 
123
  )
124
  clear_btn = gr.Button("🗑️ Clear Chat", variant="secondary")
125
 
126
+ # Основная колонка
127
  with gr.Column(scale=1):
128
  chatbot = gr.Chatbot(
129
  label="Code Assistant",
130
  elem_id="chatbot",
131
  avatar_images=(None, "https://api.iconify.design/noto:robot.svg"),
 
132
  scale=1,
133
+ type="messages",
134
  )
135
 
136
  with gr.Row(variant="compact"):