tori29umai commited on
Commit
d4bcb04
·
verified ·
1 Parent(s): 2815320

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -202,7 +202,7 @@ def clear_chat():
202
  # カスタムCSS
203
  custom_css = """
204
  #chatbot {
205
- height: 60vh !important;
206
  overflow-y: auto;
207
  }
208
  """
@@ -213,7 +213,7 @@ custom_js = """
213
  function adjustChatbotHeight() {
214
  var chatbot = document.querySelector('#chatbot');
215
  if (chatbot) {
216
- chatbot.style.height = window.innerHeight * 0.6 + 'px';
217
  }
218
  }
219
  // ページ読み込み時と画面サイズ変更時にチャットボットの高さを調整
@@ -224,6 +224,7 @@ window.addEventListener('resize', adjustChatbotHeight);
224
 
225
  # Gradioインターフェースの設定
226
  with gr.Blocks(css=custom_css) as iface:
 
227
  chatbot = gr.Chatbot(elem_id="chatbot")
228
 
229
  with gr.Tab("チャット"):
 
202
  # カスタムCSS
203
  custom_css = """
204
  #chatbot {
205
+ height: 50vh !important;
206
  overflow-y: auto;
207
  }
208
  """
 
213
  function adjustChatbotHeight() {
214
  var chatbot = document.querySelector('#chatbot');
215
  if (chatbot) {
216
+ chatbot.style.height = '50vh';
217
  }
218
  }
219
  // ページ読み込み時と画面サイズ変更時にチャットボットの高さを調整
 
224
 
225
  # Gradioインターフェースの設定
226
  with gr.Blocks(css=custom_css) as iface:
227
+ gr.HTML(custom_js) # カスタムJavaScriptを追加
228
  chatbot = gr.Chatbot(elem_id="chatbot")
229
 
230
  with gr.Tab("チャット"):