bleysg commited on
Commit
7a84795
Β·
1 Parent(s): 0f2c752

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -68,6 +68,8 @@ CSS ="""
68
  .gradio-container { height: 100vh !important; }
69
  #component-0 { height: 100%; }
70
  #chatbot { flex-grow: 1; overflow: auto; resize: vertical; }
 
 
71
  """
72
 
73
  #with gr.Blocks() as demo:
@@ -81,8 +83,11 @@ with gr.Blocks(css=CSS) as demo:
81
  with gr.Row():
82
  gr.Markdown("# πŸ” WizardCoder-Python-34B-V1.0-GGUF Playground Space! πŸ”Ž")
83
  with gr.Row():
84
- #chatbot = gr.Chatbot().style(height=500)
85
- chatbot = gr.Chatbot(elem_id="chatbot")
 
 
 
86
  with gr.Row():
87
  message = gr.Textbox(
88
  label="What do you want to chat about?",
@@ -107,12 +112,13 @@ with gr.Blocks(css=CSS) as demo:
107
 
108
  chat_history_state = gr.State()
109
  clear.click(clear_chat, inputs=[chat_history_state, message], outputs=[chat_history_state, message], queue=False)
110
- clear.click(lambda: None, None, chatbot, queue=False)
 
111
 
112
  submit_click_event = submit.click(
113
  fn=user, inputs=[message, chat_history_state], outputs=[message, chat_history_state], queue=True
114
  ).then(
115
- fn=chat, inputs=[chat_history_state, system_msg, max_tokens, temperature, top_p, top_k, repetition_penalty], outputs=[chatbot, chat_history_state, message], queue=True
116
  )
117
  stop.click(fn=None, inputs=None, outputs=None, cancels=[submit_click_event], queue=False)
118
 
 
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:
 
83
  with gr.Row():
84
  gr.Markdown("# πŸ” WizardCoder-Python-34B-V1.0-GGUF Playground Space! πŸ”Ž")
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
 
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