Dalleon commited on
Commit
35531dd
1 Parent(s): 2e954fc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -147,6 +147,9 @@ def user1(user_message, history):
147
  history.append([user_message, None])
148
  return "", history # clear user_message
149
 
 
 
 
150
  def bot(history):
151
  user_message = history[-1][0]
152
  response = []
@@ -282,6 +285,12 @@ with gr.Blocks(
282
  cancels=[msg_submit_event, submit_click_event],
283
  queue=False,
284
  )
 
 
 
 
 
 
285
  clear.click(lambda: None, None, chatbot, queue=False)
286
 
287
  with gr.Accordion("For Chat/Translation API", open=False, visible=False):
 
147
  history.append([user_message, None])
148
  return "", history # clear user_message
149
 
150
+ def updateprompt(ptemp):
151
+ prompt_template = ptemp
152
+
153
  def bot(history):
154
  user_message = history[-1][0]
155
  response = []
 
285
  cancels=[msg_submit_event, submit_click_event],
286
  queue=False,
287
  )
288
+ change.click(
289
+ fn=None,
290
+ inputs=None,
291
+ outputs=None,
292
+ queue=False,
293
+ ).then(updateprompt, chatbot, chatbot, queue=True)
294
  clear.click(lambda: None, None, chatbot, queue=False)
295
 
296
  with gr.Accordion("For Chat/Translation API", open=False, visible=False):