NikhilJoson commited on
Commit
c1f4336
·
verified ·
1 Parent(s): 15219ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -62,9 +62,9 @@ def check_guess(user_guess):
62
  else:
63
  return "Incorrect. Keep trying!"
64
 
65
- # Reveal the answer
66
  def reveal_answer():
67
- return f"The correct answer is: {current_name}!"
68
 
69
  # Create the Gradio interface
70
  with gr.Blocks(theme=gr.themes.Ocean()) as demo:
@@ -78,13 +78,13 @@ with gr.Blocks(theme=gr.themes.Ocean()) as demo:
78
 
79
  with gr.Row():
80
  start_button = gr.Button("Start Game", variant='huggingface')
81
- clear_button = gr.Button("Clear More", variant='primary')
82
- guess_button = gr.Button("Submit Guess", variant='secondary')
83
- reveal_button = gr.Button("Reveal Answer", variant='success')
84
 
85
  start_button.click(start_game, inputs=[], outputs=[pixelated_image, result])
86
  clear_button.click(clear_more, inputs=[], outputs=[pixelated_image, result])
87
  guess_button.click(check_guess, inputs=answer_input, outputs=result)
88
- reveal_button.click(reveal_answer, inputs=[], outputs=result)
89
 
90
  demo.launch(debug=True, show_error=True)
 
62
  else:
63
  return "Incorrect. Keep trying!"
64
 
65
+ # Reveal the answer and original image
66
  def reveal_answer():
67
+ return current_image, f"The correct answer is: {current_name}!"
68
 
69
  # Create the Gradio interface
70
  with gr.Blocks(theme=gr.themes.Ocean()) as demo:
 
78
 
79
  with gr.Row():
80
  start_button = gr.Button("Start Game", variant='huggingface')
81
+ clear_button = gr.Button("Clear More", variant='secondary')
82
+ guess_button = gr.Button("Submit Guess", variant='primary')
83
+ reveal_button = gr.Button("Reveal Answer", variant='stop')
84
 
85
  start_button.click(start_game, inputs=[], outputs=[pixelated_image, result])
86
  clear_button.click(clear_more, inputs=[], outputs=[pixelated_image, result])
87
  guess_button.click(check_guess, inputs=answer_input, outputs=result)
88
+ reveal_button.click(reveal_answer, inputs=[], outputs=[pixelated_image, result])
89
 
90
  demo.launch(debug=True, show_error=True)