Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,7 +102,7 @@ def reset_user_input():
|
|
| 102 |
|
| 103 |
def reset_state():
|
| 104 |
history = gr.State(init_history)
|
| 105 |
-
return '', '',
|
| 106 |
|
| 107 |
|
| 108 |
def allow_user_input():
|
|
@@ -132,7 +132,6 @@ with gr.Blocks() as demo:
|
|
| 132 |
[user_input, max_length, top_p, temperature, history],
|
| 133 |
[five_sample, history], show_progress=True
|
| 134 |
)
|
| 135 |
-
submitBtn.click(reset_user_input, [], [user_input])
|
| 136 |
submitBtn.click(reset_user_input, [], [final_sample])
|
| 137 |
submitBtn.click(allow_user_input, [], [expand])
|
| 138 |
|
|
@@ -144,5 +143,6 @@ with gr.Blocks() as demo:
|
|
| 144 |
emptyBtn.click(reset_state,
|
| 145 |
outputs=[five_sample, final_sample, history, expand],
|
| 146 |
show_progress=True)
|
|
|
|
| 147 |
|
| 148 |
demo.queue().launch(share=False, inbrowser=True)
|
|
|
|
| 102 |
|
| 103 |
def reset_state():
|
| 104 |
history = gr.State(init_history)
|
| 105 |
+
return '', '', history, gr.Dropdown(["1", "2", "3", "4", "5"], label="Step2:進一步擴展的範例", value=None, interactive=False)
|
| 106 |
|
| 107 |
|
| 108 |
def allow_user_input():
|
|
|
|
| 132 |
[user_input, max_length, top_p, temperature, history],
|
| 133 |
[five_sample, history], show_progress=True
|
| 134 |
)
|
|
|
|
| 135 |
submitBtn.click(reset_user_input, [], [final_sample])
|
| 136 |
submitBtn.click(allow_user_input, [], [expand])
|
| 137 |
|
|
|
|
| 143 |
emptyBtn.click(reset_state,
|
| 144 |
outputs=[five_sample, final_sample, history, expand],
|
| 145 |
show_progress=True)
|
| 146 |
+
emptyBtn.click(reset_user_input, [], [user_input])
|
| 147 |
|
| 148 |
demo.queue().launch(share=False, inbrowser=True)
|