Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -307,58 +307,58 @@ with gr.Blocks(css=STYLE, elem_id='container-col') as demo:
|
|
307 |
|
308 |
with gr.Row():
|
309 |
with gr.Column(scale=1, min_width=180):
|
310 |
-
|
311 |
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
|
319 |
with gr.Column(scale=8, elem_id="right-pane"):
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
|
347 |
for btn in channel_btns:
|
348 |
btn.click(
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
).then(
|
353 |
-
|
354 |
-
|
355 |
)
|
356 |
|
357 |
for btn in ex_btns:
|
358 |
btn.click(
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
)
|
363 |
|
364 |
instruction_txtbox.submit(
|
|
|
307 |
|
308 |
with gr.Row():
|
309 |
with gr.Column(scale=1, min_width=180):
|
310 |
+
gr.Markdown("GradioChat", elem_id="left-top")
|
311 |
|
312 |
+
with gr.Column(elem_id="left-pane"):
|
313 |
+
with gr.Accordion("Histories", elem_id="chat-history-accordion"):
|
314 |
+
channel_btns.append(gr.Button(channels[0], elem_classes=["custom-btn-highlight"]))
|
315 |
+
|
316 |
+
for channel in channels[1:]:
|
317 |
+
channel_btns.append(gr.Button(channel, elem_classes=["custom-btn"]))
|
318 |
|
319 |
with gr.Column(scale=8, elem_id="right-pane"):
|
320 |
+
with gr.Column(elem_id="initial-popup", visible=False) as example_block:
|
321 |
+
with gr.Row(scale=1):
|
322 |
+
with gr.Column(elem_id="initial-popup-left-pane"):
|
323 |
+
gr.Markdown("GradioChat", elem_id="initial-popup-title")
|
324 |
+
gr.Markdown("Making the community's best AI chat models available to everyone.")
|
325 |
+
with gr.Column(elem_id="initial-popup-right-pane"):
|
326 |
+
gr.Markdown("Chat UI is now open sourced on Hugging Face Hub")
|
327 |
+
gr.Markdown("check out the [↗ repository](https://huggingface.co/spaces/chansung/test-multi-conv)")
|
328 |
+
|
329 |
+
with gr.Column(scale=1):
|
330 |
+
gr.Markdown("Examples")
|
331 |
+
with gr.Row() as text_block:
|
332 |
+
for example in examples:
|
333 |
+
ex_btns.append(gr.Button(example, elem_classes=["example-btn"]))
|
334 |
+
|
335 |
+
with gr.Column(elem_id="aux-btns-popup", visible=True):
|
336 |
+
with gr.Row():
|
337 |
+
stop = gr.Button("Stop", elem_classes=["aux-btn"])
|
338 |
+
regenerate = gr.Button("Regenerate", elem_classes=["aux-btn"])
|
339 |
+
clean = gr.Button("Clean", elem_classes=["aux-btn"])
|
340 |
+
|
341 |
+
chatbot = gr.Chatbot(elem_id='chatbot')
|
342 |
+
instruction_txtbox = gr.Textbox(
|
343 |
+
placeholder="Ask anything", label="",
|
344 |
+
elem_id="prompt-txt"
|
345 |
+
)
|
346 |
|
347 |
for btn in channel_btns:
|
348 |
btn.click(
|
349 |
+
set_chatbot,
|
350 |
+
[btn, local_data],
|
351 |
+
[chatbot, idx, example_block]
|
352 |
).then(
|
353 |
+
None, btn, None,
|
354 |
+
_js=update_left_btns_state
|
355 |
)
|
356 |
|
357 |
for btn in ex_btns:
|
358 |
btn.click(
|
359 |
+
set_example,
|
360 |
+
[btn],
|
361 |
+
[instruction_txtbox, example_block]
|
362 |
)
|
363 |
|
364 |
instruction_txtbox.submit(
|