Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -147,7 +147,7 @@ def check_rand(inp,val):
|
|
147 |
return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
|
148 |
|
149 |
with gr.Blocks() as app:
|
150 |
-
gr.HTML("""<center><h1 style='font-size:xx-large;'>
|
151 |
with gr.Row():
|
152 |
chat_a = gr.Chatbot(height=500)
|
153 |
chat_b = gr.Chatbot(height=500)
|
@@ -197,10 +197,10 @@ with gr.Blocks() as app:
|
|
197 |
#im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
198 |
#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)
|
199 |
|
200 |
-
go1=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid1],chat_a)
|
201 |
-
go2=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid2],chat_b)
|
202 |
-
go3=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid3],chat_c)
|
203 |
-
go4=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid4],chat_d)
|
204 |
|
205 |
stop_btn.click(None,None,None,cancels=[go1,go2,go3,go4])
|
206 |
clear_btn.click(clear_fn,None,[inp,sys_inp,chat_a,chat_b,chat_c,chat_d])
|
|
|
147 |
return gr.Slider(label="Seed", minimum=1, maximum=1111111111111111, value=int(val))
|
148 |
|
149 |
with gr.Blocks() as app:
|
150 |
+
gr.HTML("""<center><h1 style='font-size:xx-large;'>Chatbot Model Compare</h1><br><h3>running on Huggingface Inference Client</h3><br><h7>EXPERIMENTAL""")
|
151 |
with gr.Row():
|
152 |
chat_a = gr.Chatbot(height=500)
|
153 |
chat_b = gr.Chatbot(height=500)
|
|
|
197 |
#im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
198 |
#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)
|
199 |
|
200 |
+
go1=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid1],chat_a,batch=True, max_batch_size=16)
|
201 |
+
go2=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid2],chat_b,batch=True, max_batch_size=16)
|
202 |
+
go3=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid3],chat_c,batch=True, max_batch_size=16)
|
203 |
+
go4=btn.click(check_rand,[rand,seed],seed).then(chat_inf,[sys_inp,inp,chat_b,client_choice,seed,temp,tokens,top_p,rep_p,hid4],chat_d,batch=True, max_batch_size=16)
|
204 |
|
205 |
stop_btn.click(None,None,None,cancels=[go1,go2,go3,go4])
|
206 |
clear_btn.click(clear_fn,None,[inp,sys_inp,chat_a,chat_b,chat_c,chat_d])
|