Omnibus commited on
Commit
f29cff9
1 Parent(s): c47b3e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -28,15 +28,15 @@ client_z=[]
28
 
29
  def load_models(inp):
30
 
31
- out_box=[]
32
  print(type(inp))
33
  print(inp)
34
  print(models[inp[0]])
35
  client_z.clear()
36
- for z,ea in inp:
37
  client_z.append(InferenceClient(models[inp[z]]))
38
- out_box.append(gr.update(label=models[inp[z]]))
39
- return out_box[0]
40
 
41
 
42
  def format_prompt(message, history):
@@ -143,7 +143,7 @@ with gr.Blocks() as app:
143
  theme=gr.Radio(label="Theme", choices=["light","dark"],value="light")
144
  chatblock=gr.Dropdown(label="Chatblocks",info="Choose specific blocks of chat",choices=[c for c in range(1,40)],multiselect=True)
145
 
146
- client_choice.change(load_models,client_choice,chat_a)
147
 
148
  #im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
149
  #chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p],chat_b)
 
28
 
29
  def load_models(inp):
30
 
31
+ out_box=[gr.Chatbot(),gr.Chatbot(),gr.Chatbot(),gr.Chatbot()]
32
  print(type(inp))
33
  print(inp)
34
  print(models[inp[0]])
35
  client_z.clear()
36
+ for z,ea in enumerate(inp):
37
  client_z.append(InferenceClient(models[inp[z]]))
38
+ out_box[z]=(gr.update(label=models[inp[z]]))
39
+ return out_box[0],out_box[1],out_box[2],out_box[3]
40
 
41
 
42
  def format_prompt(message, history):
 
143
  theme=gr.Radio(label="Theme", choices=["light","dark"],value="light")
144
  chatblock=gr.Dropdown(label="Chatblocks",info="Choose specific blocks of chat",choices=[c for c in range(1,40)],multiselect=True)
145
 
146
+ client_choice.change(load_models,client_choice,[chat_a,chat_b,chat_c,chat_d])
147
 
148
  #im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
149
  #chat_sub=inp.submit(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p],chat_b)