ryanrwatkins commited on
Commit
0e71847
1 Parent(s): b982841

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -73,7 +73,11 @@ def download_prompt_templates():
73
 
74
  def on_prompt_template_change(prompt_template):
75
  if not isinstance(prompt_template, str): return
76
- return prompt_templates[prompt_template], actor_description[prompt_template]
 
 
 
 
77
 
78
 
79
 
@@ -252,8 +256,8 @@ with gr.Blocks(css=css) as demo:
252
  btn_submit.click(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
253
  input_message.submit(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
254
  btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
255
- prompt_template.change(on_prompt_template_change, inputs=[actor_description], outputs=[prompt_template_preview])
256
-
257
 
258
 
259
  demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template], queur=False)
 
73
 
74
  def on_prompt_template_change(prompt_template):
75
  if not isinstance(prompt_template, str): return
76
+ return prompt_templates[prompt_template]
77
+
78
+ def on_prompt_template_change_description(prompt_template):
79
+ if not isinstance(prompt_template, str): return
80
+ return actor_description[prompt_template]
81
 
82
 
83
 
 
256
  btn_submit.click(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
257
  input_message.submit(submit_message, [ input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
258
  btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
259
+ prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[prompt_template_preview])
260
+ prompt_template.change(on_prompt_template_change_description, inputs=[prompt_template], outputs[1]=[prompt_template_preview])
261
 
262
 
263
  demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template], queur=False)