Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -221,7 +221,7 @@ def chat_inf_d(system_prompt,prompt,history,client_choice,seed,temp,tokens,top_p
|
|
221 |
yield None
|
222 |
def add_new_model(inp, cur):
|
223 |
cur.append(inp)
|
224 |
-
return cur
|
225 |
def load_new(models=models):
|
226 |
return models
|
227 |
|
@@ -255,7 +255,7 @@ with gr.Blocks() as app:
|
|
255 |
with gr.Group():
|
256 |
stop_btn=gr.Button("Stop")
|
257 |
clear_btn=gr.Button("Clear")
|
258 |
-
client_choice=gr.Dropdown(label="Models",type='index',choices=[c for c in
|
259 |
add_model=gr.Textbox(label="New Model")
|
260 |
add_btn=gr.Button("Add Model")
|
261 |
with gr.Column(scale=1):
|
@@ -284,7 +284,7 @@ with gr.Blocks() as app:
|
|
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 |
|
290 |
#im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|
|
|
221 |
yield None
|
222 |
def add_new_model(inp, cur):
|
223 |
cur.append(inp)
|
224 |
+
return cur,gr.update(choices=[z for z in cur])
|
225 |
def load_new(models=models):
|
226 |
return models
|
227 |
|
|
|
255 |
with gr.Group():
|
256 |
stop_btn=gr.Button("Stop")
|
257 |
clear_btn=gr.Button("Clear")
|
258 |
+
client_choice=gr.Dropdown(label="Models",type='index',choices=[c for c in models],max_choices=4,multiselect=True,interactive=True)
|
259 |
add_model=gr.Textbox(label="New Model")
|
260 |
add_btn=gr.Button("Add Model")
|
261 |
with gr.Column(scale=1):
|
|
|
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,client_choice])
|
288 |
client_choice.change(load_models,client_choice,[chat_a,chat_b,chat_c,chat_d])
|
289 |
|
290 |
#im_go=im_btn.click(get_screenshot,[chat_b,im_height,im_width,chatblock,theme,wait_time],img)
|