Spaces:
Running
on
Zero
Running
on
Zero
tori29umai
commited on
Commit
•
33ce99e
1
Parent(s):
03c9739
Update app.py
Browse files
app.py
CHANGED
@@ -273,6 +273,20 @@ window.addEventListener('resize', adjustChatbotHeight);
|
|
273 |
|
274 |
# Gradioインターフェースの設定
|
275 |
with gr.Blocks(css=custom_css) as iface:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
276 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
277 |
|
278 |
with gr.Tab("チャット"):
|
@@ -348,7 +362,6 @@ if __name__ == "__main__":
|
|
348 |
iface.launch(
|
349 |
share=True,
|
350 |
allowed_paths=["models"],
|
351 |
-
favicon_path="custom.html"
|
352 |
-
html=f"<html><head>{custom_js}</head><body><div id='gradio-app'></div></body></html>"
|
353 |
)
|
354 |
|
|
|
273 |
|
274 |
# Gradioインターフェースの設定
|
275 |
with gr.Blocks(css=custom_css) as iface:
|
276 |
+
gr.HTML("""
|
277 |
+
<script>
|
278 |
+
function adjustChatbotHeight() {
|
279 |
+
var chatbot = document.querySelector('#chatbot');
|
280 |
+
if (chatbot) {
|
281 |
+
chatbot.style.height = window.innerHeight * 0.4 + 'px';
|
282 |
+
}
|
283 |
+
}
|
284 |
+
// ページ読み込み時と画面サイズ変更時にチャットボットの高さを調整
|
285 |
+
window.addEventListener('load', adjustChatbotHeight);
|
286 |
+
window.addEventListener('resize', adjustChatbotHeight);
|
287 |
+
</script>
|
288 |
+
""")
|
289 |
+
|
290 |
chatbot = gr.Chatbot(elem_id="chatbot")
|
291 |
|
292 |
with gr.Tab("チャット"):
|
|
|
362 |
iface.launch(
|
363 |
share=True,
|
364 |
allowed_paths=["models"],
|
365 |
+
favicon_path="custom.html"
|
|
|
366 |
)
|
367 |
|