Omnibus commited on
Commit
4e460ca
1 Parent(s): f320162

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -222,7 +222,9 @@ def chat_inf_d(system_prompt,prompt,history,client_choice,seed,temp,tokens,top_p
222
  def add_new_model(inp, cur):
223
  cur.append(inp)
224
  return cur
225
-
 
 
226
  def clear_fn():
227
  return None,None,None,None,None,None
228
  rand_val=random.randint(1,1111111111111111)
@@ -233,7 +235,7 @@ def check_rand(inp,val):
233
  return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
234
 
235
  with gr.Blocks() as app:
236
- new_models=gr.State(models)
237
  gr.HTML("""<center><h1 style='font-size:xx-large;'>Chatbot Model Compare</h1><br><h3>running on Huggingface Inference Client</h3><br><h7>EXPERIMENTAL""")
238
  with gr.Row():
239
  chat_a = gr.Chatbot(height=500)
@@ -281,7 +283,7 @@ with gr.Blocks() as app:
281
  hid3=gr.Number(value=3,visible=False)
282
  hid4=gr.Number(value=4,visible=False)
283
 
284
-
285
  add_btn.click(add_new_model,[add_model,new_models],new_models)
286
  client_choice.change(load_models,client_choice,[chat_a,chat_b,chat_c,chat_d])
287
 
 
222
  def add_new_model(inp, cur):
223
  cur.append(inp)
224
  return cur
225
+ def load_new(models=models):
226
+ return models
227
+
228
  def clear_fn():
229
  return None,None,None,None,None,None
230
  rand_val=random.randint(1,1111111111111111)
 
235
  return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
236
 
237
  with gr.Blocks() as app:
238
+ new_models=gr.State([])
239
  gr.HTML("""<center><h1 style='font-size:xx-large;'>Chatbot Model Compare</h1><br><h3>running on Huggingface Inference Client</h3><br><h7>EXPERIMENTAL""")
240
  with gr.Row():
241
  chat_a = gr.Chatbot(height=500)
 
283
  hid3=gr.Number(value=3,visible=False)
284
  hid4=gr.Number(value=4,visible=False)
285
 
286
+ app.load(load_new,None,new_models)
287
  add_btn.click(add_new_model,[add_model,new_models],new_models)
288
  client_choice.change(load_models,client_choice,[chat_a,chat_b,chat_c,chat_d])
289