chansung commited on
Commit
23d7269
1 Parent(s): d7c22fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -304,10 +304,10 @@ with gr.Blocks(css=MODEL_SELECTION_CSS, theme='gradio/soft') as demo:
304
  global_context, res_temp, res_topk, res_rpen, res_mnts, res_sample, ctx_num_lconv],
305
  [instruction_txtbox, context_inspector, chatbot, local_data]
306
  )
307
- # instruction_txtbox.submit(
308
- # None, local_data, None,
309
- # _js="(v)=>{ setStorage('local_data',v) }"
310
- # )
311
 
312
  # regen_event1 = regenerate.click(
313
  # rollback_last,
@@ -330,21 +330,21 @@ with gr.Blocks(css=MODEL_SELECTION_CSS, theme='gradio/soft') as demo:
330
  # _js="(v)=>{ setStorage('local_data',v) }"
331
  # )
332
 
333
- # regen_event = regenerate.click(
334
- # rollback_last,
335
- # [idx, local_data, chat_state,
336
- # global_context, res_temp, res_topk, res_rpen, res_mnts, res_sample, ctx_num_lconv],
337
- # [context_inspector, chatbot, local_data, regenerate]
338
- # )
339
- # regenerate.click(
340
- # None, local_data, None,
341
- # _js="(v)=>{ setStorage('local_data',v) }"
342
- # )
343
 
344
- # stop.click(
345
- # None, None, None,
346
- # cancels=[send_event, regen_event]
347
- # )
348
 
349
  for btn in channel_btns:
350
  btn.click(
 
304
  global_context, res_temp, res_topk, res_rpen, res_mnts, res_sample, ctx_num_lconv],
305
  [instruction_txtbox, context_inspector, chatbot, local_data]
306
  )
307
+ instruction_txtbox.submit(
308
+ None, local_data, None,
309
+ _js="(v)=>{ setStorage('local_data',v) }"
310
+ )
311
 
312
  # regen_event1 = regenerate.click(
313
  # rollback_last,
 
330
  # _js="(v)=>{ setStorage('local_data',v) }"
331
  # )
332
 
333
+ regen_event = regenerate.click(
334
+ rollback_last,
335
+ [idx, local_data, chat_state,
336
+ global_context, res_temp, res_topk, res_rpen, res_mnts, res_sample, ctx_num_lconv],
337
+ [context_inspector, chatbot, local_data, regenerate]
338
+ )
339
+ regenerate.click(
340
+ None, local_data, None,
341
+ _js="(v)=>{ setStorage('local_data',v) }"
342
+ )
343
 
344
+ stop.click(
345
+ None, None, None,
346
+ cancels=[send_event, regen_event]
347
+ )
348
 
349
  for btn in channel_btns:
350
  btn.click(