Aswini96 commited on
Commit
c79c8ea
·
verified ·
1 Parent(s): eb869aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -117,21 +117,20 @@ with gr.Blocks() as app:
117
  with gr.Row():
118
  descripion, _0, _1 = start_new_game()
119
  gr.Markdown(descripion)
 
 
120
 
121
  user_prompt = gr.Textbox(label="Your Prompt", placeholder="Enter your prompt here...")
122
  game_output = gr.Textbox(label="AI Response", interactive=False)
123
  attempts = gr.Number(value=0, interactive=False, label="Attempts")
124
  current_level = gr.State(value=0) # Track the current level
125
-
126
- with gr.Row():
127
- current_level = gr.Textbox(f"### {int(current_level.value)+1}", label="Gemini predicted item")
128
 
129
  with gr.Row():
130
  submit_button = gr.Button("Submit")
131
  new_game_button = gr.Button("Start New Game")
132
 
133
- submit_button.click(jailbreak_game, [user_prompt, current_level, attempts], [game_output, current_level, attempts])
134
- new_game_button.click(start_new_game, [], [game_output, current_level, attempts])
135
 
136
  # Launch the app
137
  app.launch()
 
117
  with gr.Row():
118
  descripion, _0, _1 = start_new_game()
119
  gr.Markdown(descripion)
120
+ with gr.Row():
121
+ curr_level = gr.Textbox(f"### {int(current_level.value)+1}", label="LEVEL")
122
 
123
  user_prompt = gr.Textbox(label="Your Prompt", placeholder="Enter your prompt here...")
124
  game_output = gr.Textbox(label="AI Response", interactive=False)
125
  attempts = gr.Number(value=0, interactive=False, label="Attempts")
126
  current_level = gr.State(value=0) # Track the current level
 
 
 
127
 
128
  with gr.Row():
129
  submit_button = gr.Button("Submit")
130
  new_game_button = gr.Button("Start New Game")
131
 
132
+ submit_button.click(jailbreak_game, [user_prompt, current_level, attempts], [game_output, curr_level, attempts])
133
+ new_game_button.click(start_new_game, [], [game_output, curr_level, attempts])
134
 
135
  # Launch the app
136
  app.launch()