AnatoliiG commited on
Commit
4a443a6
·
1 Parent(s): 3d02f76
Files changed (2) hide show
  1. app.py +0 -1
  2. ui.py +12 -9
app.py CHANGED
@@ -1,4 +1,3 @@
1
- # app.py
2
  import json
3
 
4
  import uvicorn
 
 
1
  import json
2
 
3
  import uvicorn
ui.py CHANGED
@@ -7,18 +7,23 @@ from model import engine
7
  from utils import sanitize_content
8
 
9
  # --- CSS стили ---
 
10
  CUSTOM_CSS = """
11
- body, .gradio-container {
12
- overflow: hidden !important;
13
  height: 100vh !important;
14
- max_height: 100vh !important;
 
 
15
  }
16
  #chatbot {
17
- height: 100% !important;
 
18
  flex-grow: 1;
19
  overflow: auto;
20
  font-family: 'Consolas', 'Monaco', monospace;
21
  }
 
22
  """
23
 
24
  # --- Логика событий ---
@@ -99,7 +104,6 @@ def set_interactive(is_interactive):
99
  def create_ui():
100
  theme = gr.themes.Soft(primary_hue="blue", text_size="lg")
101
 
102
- # fill_height=True здесь заставляет Gradio растягивать интерфейс
103
  with gr.Blocks(
104
  theme=theme, css=CUSTOM_CSS, title="Qwen Coder Pro", fill_height=True
105
  ) as demo:
@@ -118,15 +122,14 @@ def create_ui():
118
  )
119
  clear_btn = gr.Button("🗑️ Clear Chat", variant="secondary")
120
 
121
- # ИСПРАВЛЕНИЕ: Заменили fill_height=True на scale=1
122
- # scale=1 говорит колонке "займи всё оставшееся место"
123
  with gr.Column(scale=1):
124
  chatbot = gr.Chatbot(
125
  label="Code Assistant",
126
  elem_id="chatbot",
127
  avatar_images=(None, "https://api.iconify.design/noto:robot.svg"),
128
- show_copy_button=True,
129
- scale=1, # Чатбот тоже растягивается внутри колонки
130
  bubble_full_width=False,
131
  )
132
 
 
7
  from utils import sanitize_content
8
 
9
  # --- CSS стили ---
10
+ # Обновляем CSS для максимального использования пространства
11
  CUSTOM_CSS = """
12
+ .gradio-container {
13
+ width: 100% !important;
14
  height: 100vh !important;
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
  # --- Логика событий ---
 
104
  def create_ui():
105
  theme = gr.themes.Soft(primary_hue="blue", text_size="lg")
106
 
 
107
  with gr.Blocks(
108
  theme=theme, css=CUSTOM_CSS, title="Qwen Coder Pro", fill_height=True
109
  ) as demo:
 
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