Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -202,7 +202,7 @@ def clear_chat():
|
|
202 |
# カスタムCSS
|
203 |
custom_css = """
|
204 |
#chatbot {
|
205 |
-
height:
|
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 =
|
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("チャット"):
|