Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,12 @@ def generate_response(model_name, message, chat_history):
|
|
14 |
return "", chat_history
|
15 |
|
16 |
# Create Gradio UI
|
17 |
-
with gr.Blocks(
|
|
|
|
|
|
|
|
|
|
|
18 |
gr.Markdown("# GPT4All Chatbot")
|
19 |
with gr.Row():
|
20 |
with gr.Column(scale=1):
|
@@ -30,8 +35,8 @@ with gr.Blocks() as demo:
|
|
30 |
# Link the dropdown with the textbox to update the description based on the selected model
|
31 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
32 |
|
33 |
-
with gr.Column(scale=4):
|
34 |
-
chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")])
|
35 |
|
36 |
message = gr.Textbox(label="Message")
|
37 |
|
|
|
14 |
return "", chat_history
|
15 |
|
16 |
# Create Gradio UI
|
17 |
+
with gr.Blocks(
|
18 |
+
css=".contain { display: flex !important; flex-direction: column !important; }"
|
19 |
+
"#component-0, #component-3, #component-10, #component-8 { height: 100% !important; }"
|
20 |
+
"#chatbot { flex-grow: 1 !important; overflow: auto !important;}"
|
21 |
+
"#col { height: calc(100vh - 112px - 16px) !important; }"
|
22 |
+
) as demo:
|
23 |
gr.Markdown("# GPT4All Chatbot")
|
24 |
with gr.Row():
|
25 |
with gr.Column(scale=1):
|
|
|
35 |
# Link the dropdown with the textbox to update the description based on the selected model
|
36 |
model_dropdown.change(fn=llm_intro, inputs=model_dropdown, outputs=explanation)
|
37 |
|
38 |
+
with gr.Column(scale=4, elem_id='col'):
|
39 |
+
chatbot = gr.Chatbot(label="Chatroom", value=[(None, "How may I help you today?")], elem_id="chatbot")
|
40 |
|
41 |
message = gr.Textbox(label="Message")
|
42 |
|