jerpint commited on
Commit
96633c3
1 Parent(s): fa8c670

clear prompts when switching levels

Browse files
Files changed (1) hide show
  1. hackaprompt/gradio_app.py +5 -2
hackaprompt/gradio_app.py CHANGED
@@ -50,8 +50,11 @@ def get_level_info(level: int):
50
  full_description = get_evaluator_description(evaluator)
51
  formatted_prompt = get_evaluator_formatted_prompt(evaluator)
52
  expected_completion = get_evaluator_expected_completion(evaluator)
 
 
 
53
 
54
- return full_description, formatted_prompt, expected_completion
55
 
56
 
57
  def toggle_second_prompt_visibility(level):
@@ -172,7 +175,7 @@ with gr.Blocks() as demo:
172
  prompt = gr.Textbox(lines=4, label="Votre Prompt")
173
  evaluate_button = gr.Button("Évaluer 📝")
174
 
175
- level.change(fn=get_level_info, inputs=level, outputs=[challenge, prompt_template, expected_completion])
176
 
177
  evaluate_button.click(
178
  fn=evaluate,
 
50
  full_description = get_evaluator_description(evaluator)
51
  formatted_prompt = get_evaluator_formatted_prompt(evaluator)
52
  expected_completion = get_evaluator_expected_completion(evaluator)
53
+ completion = ""
54
+ full_prompt = ""
55
+ evaluation = ""
56
 
57
+ return full_description, formatted_prompt, expected_completion, completion, full_prompt, evaluation
58
 
59
 
60
  def toggle_second_prompt_visibility(level):
 
175
  prompt = gr.Textbox(lines=4, label="Votre Prompt")
176
  evaluate_button = gr.Button("Évaluer 📝")
177
 
178
+ level.change(fn=get_level_info, inputs=level, outputs=[challenge, prompt_template, expected_completion, completion, full_prompt, evaluation])
179
 
180
  evaluate_button.click(
181
  fn=evaluate,