Spaces:
Running
Running
Commit
·
c6eddc8
1
Parent(s):
d62edfd
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def download_prompt_templates():
|
|
42 |
|
43 |
choices = list(prompt_templates.keys())
|
44 |
choices = choices[:1] + sorted(choices[1:])
|
45 |
-
return gr.update(value=choices[0], choices=choices)
|
46 |
|
47 |
def on_prompt_template_change(prompt_template):
|
48 |
if not isinstance(prompt_template, str): return
|
@@ -143,7 +143,7 @@ with gr.Blocks(css=css) as demo:
|
|
143 |
btn_submit.click(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
144 |
input_message.submit(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
145 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
146 |
-
prompt_template.change(on_prompt_template_change, inputs=[
|
147 |
|
148 |
|
149 |
|
|
|
42 |
|
43 |
choices = list(prompt_templates.keys())
|
44 |
choices = choices[:1] + sorted(choices[1:])
|
45 |
+
return gr.update(value=choices[0], choices=choices, description=description)
|
46 |
|
47 |
def on_prompt_template_change(prompt_template):
|
48 |
if not isinstance(prompt_template, str): return
|
|
|
143 |
btn_submit.click(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
144 |
input_message.submit(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
145 |
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
146 |
+
prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[description])
|
147 |
|
148 |
|
149 |
|