bleysg commited on
Commit
61edc53
·
1 Parent(s): 7a84795

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -67,9 +67,8 @@ CSS ="""
67
  .contain { display: flex; flex-direction: column; }
68
  .gradio-container { height: 100vh !important; }
69
  #component-0 { height: 100%; }
70
- #chatbot { flex-grow: 1; overflow: auto; resize: vertical; }
71
- #chatbot_gguf { flex-grow: 1; overflow: auto; resize: vertical; }
72
- #chatbot_gguf2 { flex-grow: 1; overflow: auto; resize: vertical; }
73
  """
74
 
75
  #with gr.Blocks() as demo:
@@ -85,9 +84,9 @@ with gr.Blocks(css=CSS) as demo:
85
  with gr.Row():
86
  with gr.Column():
87
  #chatbot = gr.Chatbot().style(height=500)
88
- chatbot = gr.Chatbot(elem_id="chatbot_gguf")
89
  with gr.Column():
90
- chatbot = gr.Chatbot(elem_id="chatbot_gguf2")
91
  with gr.Row():
92
  message = gr.Textbox(
93
  label="What do you want to chat about?",
@@ -112,13 +111,13 @@ with gr.Blocks(css=CSS) as demo:
112
 
113
  chat_history_state = gr.State()
114
  clear.click(clear_chat, inputs=[chat_history_state, message], outputs=[chat_history_state, message], queue=False)
115
- clear.click(lambda: None, None, chatbot_gguf, queue=False)
116
- clear.click(lambda: None, None, chatbot_gguf2, queue=False)
117
 
118
  submit_click_event = submit.click(
119
  fn=user, inputs=[message, chat_history_state], outputs=[message, chat_history_state], queue=True
120
  ).then(
121
- fn=chat, inputs=[chat_history_state, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty], outputs=[chatbot_gguf, chat_history_state, message], queue=True
122
  )
123
  stop.click(fn=None, inputs=None, outputs=None, cancels=[submit_click_event], queue=False)
124
 
 
67
  .contain { display: flex; flex-direction: column; }
68
  .gradio-container { height: 100vh !important; }
69
  #component-0 { height: 100%; }
70
+ #chatbot1 { flex-grow: 1; overflow: auto; resize: vertical; }
71
+ #chatbot2 { flex-grow: 1; overflow: auto; resize: vertical; }
 
72
  """
73
 
74
  #with gr.Blocks() as demo:
 
84
  with gr.Row():
85
  with gr.Column():
86
  #chatbot = gr.Chatbot().style(height=500)
87
+ chatbot1 = gr.Chatbot(elem_id="chatbot1")
88
  with gr.Column():
89
+ chatbot2 = gr.Chatbot(elem_id="chatbot2")
90
  with gr.Row():
91
  message = gr.Textbox(
92
  label="What do you want to chat about?",
 
111
 
112
  chat_history_state = gr.State()
113
  clear.click(clear_chat, inputs=[chat_history_state, message], outputs=[chat_history_state, message], queue=False)
114
+ clear.click(lambda: None, None, chatbot1, queue=False)
115
+ clear.click(lambda: None, None, chatbot2, queue=False)
116
 
117
  submit_click_event = submit.click(
118
  fn=user, inputs=[message, chat_history_state], outputs=[message, chat_history_state], queue=True
119
  ).then(
120
+ fn=chat, inputs=[chat_history_state, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty], outputs=[chatbot1, chat_history_state, message], queue=True
121
  )
122
  stop.click(fn=None, inputs=None, outputs=None, cancels=[submit_click_event], queue=False)
123