Spaces:
Sleeping
Sleeping
state output
Browse files- src/play_interface.py +5 -5
src/play_interface.py
CHANGED
@@ -78,7 +78,7 @@ def try_play_move(
|
|
78 |
):
|
79 |
if current_board.is_game_over():
|
80 |
gr.Warning("The game is already over")
|
81 |
-
return render_board(current_board)
|
82 |
try:
|
83 |
current_board = play_user_move(move_to_play, current_board)
|
84 |
if current_board.is_game_over():
|
@@ -92,10 +92,10 @@ def try_play_move(
|
|
92 |
}
|
93 |
)
|
94 |
run.finish()
|
95 |
-
return render_board(current_board)
|
96 |
except:
|
97 |
gr.Warning("Invalid move")
|
98 |
-
return render_board(current_board)
|
99 |
temperature_retries = [
|
100 |
(i+1)/10 for i in range(10)
|
101 |
]
|
@@ -108,7 +108,7 @@ def try_play_move(
|
|
108 |
else:
|
109 |
gr.Warning("AI move failed with all temperatures")
|
110 |
current_board.pop()
|
111 |
-
return render_board(current_board)
|
112 |
|
113 |
|
114 |
with gr.Blocks() as interface:
|
@@ -161,4 +161,4 @@ with gr.Blocks() as interface:
|
|
161 |
inputs=[*static_inputs, state_board],
|
162 |
outputs=[*static_outputs, gr.State()],
|
163 |
)
|
164 |
-
interface.load(render_board, inputs=[state_board], outputs=[*static_outputs
|
|
|
78 |
):
|
79 |
if current_board.is_game_over():
|
80 |
gr.Warning("The game is already over")
|
81 |
+
return *render_board(current_board), current_board
|
82 |
try:
|
83 |
current_board = play_user_move(move_to_play, current_board)
|
84 |
if current_board.is_game_over():
|
|
|
92 |
}
|
93 |
)
|
94 |
run.finish()
|
95 |
+
return *render_board(current_board), current_board
|
96 |
except:
|
97 |
gr.Warning("Invalid move")
|
98 |
+
return *render_board(current_board), current_board
|
99 |
temperature_retries = [
|
100 |
(i+1)/10 for i in range(10)
|
101 |
]
|
|
|
108 |
else:
|
109 |
gr.Warning("AI move failed with all temperatures")
|
110 |
current_board.pop()
|
111 |
+
return *render_board(current_board), current_board
|
112 |
|
113 |
|
114 |
with gr.Blocks() as interface:
|
|
|
161 |
inputs=[*static_inputs, state_board],
|
162 |
outputs=[*static_outputs, gr.State()],
|
163 |
)
|
164 |
+
interface.load(render_board, inputs=[state_board], outputs=[*static_outputs])
|