Spaces:
Runtime error
Runtime error
KevinNuNu
commited on
Commit
•
7fec255
1
Parent(s):
3958c1a
remove buttons
Browse files
app.py
CHANGED
@@ -36,7 +36,7 @@ async def cancel_local_demo(state_chatbot: gr.State, cancel_btn: gr.Button,
|
|
36 |
state_chatbot (Sequence): the chatting history
|
37 |
request (gr.Request): the request from a user
|
38 |
"""
|
39 |
-
return (state_chatbot, disable_btn,
|
40 |
|
41 |
async def chat_stream_demo(
|
42 |
instruction: str,
|
@@ -61,7 +61,7 @@ async def chat_stream_demo(
|
|
61 |
if item[1] is not None:
|
62 |
messages.append(dict(role='assistant', content=item[1]))
|
63 |
|
64 |
-
yield (state_chatbot, state_chatbot, disable_btn,
|
65 |
f'{bot_summarized_response}'.strip())
|
66 |
|
67 |
async for outputs in InterFace.async_engine.generate(
|
@@ -86,7 +86,7 @@ async def chat_stream_demo(
|
|
86 |
yield (state_chatbot, state_chatbot, disable_btn, disable_btn,
|
87 |
f'{bot_summarized_response}'.strip())
|
88 |
|
89 |
-
yield (state_chatbot, state_chatbot, disable_btn,
|
90 |
f'{bot_summarized_response}'.strip())
|
91 |
|
92 |
|
@@ -103,8 +103,8 @@ with gr.Blocks(css=CSS, theme=THEME) as demo:
|
|
103 |
placeholder='Please input the instruction',
|
104 |
label='Instruction')
|
105 |
with gr.Row():
|
106 |
-
cancel_btn = gr.Button(value='Cancel', interactive=False)
|
107 |
-
reset_btn = gr.Button(value='Reset')
|
108 |
|
109 |
send_event = instruction_txtbox.submit(
|
110 |
chat_stream_demo,
|
|
|
36 |
state_chatbot (Sequence): the chatting history
|
37 |
request (gr.Request): the request from a user
|
38 |
"""
|
39 |
+
return (state_chatbot, disable_btn, disable_btn)
|
40 |
|
41 |
async def chat_stream_demo(
|
42 |
instruction: str,
|
|
|
61 |
if item[1] is not None:
|
62 |
messages.append(dict(role='assistant', content=item[1]))
|
63 |
|
64 |
+
yield (state_chatbot, state_chatbot, disable_btn, disable_btn,
|
65 |
f'{bot_summarized_response}'.strip())
|
66 |
|
67 |
async for outputs in InterFace.async_engine.generate(
|
|
|
86 |
yield (state_chatbot, state_chatbot, disable_btn, disable_btn,
|
87 |
f'{bot_summarized_response}'.strip())
|
88 |
|
89 |
+
yield (state_chatbot, state_chatbot, disable_btn, disable_btn,
|
90 |
f'{bot_summarized_response}'.strip())
|
91 |
|
92 |
|
|
|
103 |
placeholder='Please input the instruction',
|
104 |
label='Instruction')
|
105 |
with gr.Row():
|
106 |
+
cancel_btn = gr.Button(value='Cancel', interactive=False, visible=False)
|
107 |
+
reset_btn = gr.Button(value='Reset', interactive=False, visible=False)
|
108 |
|
109 |
send_event = instruction_txtbox.submit(
|
110 |
chat_stream_demo,
|