Spaces:
Running
on
Zero
Running
on
Zero
0.31 change select
Browse files
app.py
CHANGED
@@ -180,7 +180,8 @@ def generate_both(system_prompt, input_text, chatbot_a, chatbot_b, max_new_token
|
|
180 |
def clear():
|
181 |
return [], []
|
182 |
|
183 |
-
def
|
|
|
184 |
chatbot_a = "Hello A"
|
185 |
chatbot_b = "Hello B"
|
186 |
return chatbot_a, chatbot_b
|
@@ -212,7 +213,7 @@ with gr.Blocks() as demo:
|
|
212 |
top_p = gr.Slider(minimum=0.0, maximum=1.0, value=1.0, label="Top-p", step=0.01)
|
213 |
repetition_penalty = gr.Slider(minimum=0.1, maximum=2.0, value=1.1, label="Repetition Penalty", step=0.1)
|
214 |
|
215 |
-
|
216 |
input_text.submit(generate_both, inputs=[system_prompt, input_text, chatbot_a, chatbot_b, max_new_tokens, temperature, top_p, repetition_penalty], outputs=[chatbot_a, chatbot_b])
|
217 |
submit_btn.click(generate_both, inputs=[system_prompt, input_text, chatbot_a, chatbot_b, max_new_tokens, temperature, top_p, repetition_penalty], outputs=[chatbot_a, chatbot_b])
|
218 |
clear_btn.click(clear, outputs=[chatbot_a, chatbot_b])
|
|
|
180 |
def clear():
|
181 |
return [], []
|
182 |
|
183 |
+
def reveal_bot(choice):
|
184 |
+
logging.debug(choice)
|
185 |
chatbot_a = "Hello A"
|
186 |
chatbot_b = "Hello B"
|
187 |
return chatbot_a, chatbot_b
|
|
|
213 |
top_p = gr.Slider(minimum=0.0, maximum=1.0, value=1.0, label="Top-p", step=0.01)
|
214 |
repetition_penalty = gr.Slider(minimum=0.1, maximum=2.0, value=1.1, label="Repetition Penalty", step=0.1)
|
215 |
|
216 |
+
better_bot.select(reveal_bot, better_bot) #fckp outputs=[chatbot_a, chatbot_b]
|
217 |
input_text.submit(generate_both, inputs=[system_prompt, input_text, chatbot_a, chatbot_b, max_new_tokens, temperature, top_p, repetition_penalty], outputs=[chatbot_a, chatbot_b])
|
218 |
submit_btn.click(generate_both, inputs=[system_prompt, input_text, chatbot_a, chatbot_b, max_new_tokens, temperature, top_p, repetition_penalty], outputs=[chatbot_a, chatbot_b])
|
219 |
clear_btn.click(clear, outputs=[chatbot_a, chatbot_b])
|