Spaces:
Runtime error
Runtime error
interfacing
Browse files- src/constants.py +1 -1
- src/play_interface.py +25 -25
src/constants.py
CHANGED
|
@@ -3,5 +3,5 @@
|
|
| 3 |
|
| 4 |
import os
|
| 5 |
|
| 6 |
-
FIGURE_DIRECTORY = os.environ.get("FIGURE_DIRECTORY", "
|
| 7 |
WANDB_API_KEY = os.environ.get("WANDB_API_KEY", "")
|
|
|
|
| 3 |
|
| 4 |
import os
|
| 5 |
|
| 6 |
+
FIGURE_DIRECTORY = os.environ.get("FIGURE_DIRECTORY", ".")
|
| 7 |
WANDB_API_KEY = os.environ.get("WANDB_API_KEY", "")
|
src/play_interface.py
CHANGED
|
@@ -112,35 +112,35 @@ def try_play_move(
|
|
| 112 |
|
| 113 |
|
| 114 |
with gr.Blocks() as interface:
|
| 115 |
-
with gr.
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
max_lines=1,
|
| 120 |
-
value="",
|
| 121 |
-
)
|
| 122 |
-
current_fen = gr.Textbox(
|
| 123 |
-
label="Board FEN",
|
| 124 |
-
lines=1,
|
| 125 |
-
max_lines=1,
|
| 126 |
-
value=chess.STARTING_FEN,
|
| 127 |
-
)
|
| 128 |
-
current_pgn = gr.Textbox(
|
| 129 |
-
label="Action sequence",
|
| 130 |
-
lines=1,
|
| 131 |
-
value="",
|
| 132 |
-
)
|
| 133 |
-
with gr.Row():
|
| 134 |
-
move_to_play = gr.Textbox(
|
| 135 |
-
label="Move to play (UCI)",
|
| 136 |
lines=1,
|
| 137 |
max_lines=1,
|
| 138 |
value="",
|
| 139 |
)
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
static_inputs = [
|
| 146 |
username,
|
|
|
|
| 112 |
|
| 113 |
|
| 114 |
with gr.Blocks() as interface:
|
| 115 |
+
with gr.Row():
|
| 116 |
+
with gr.Column():
|
| 117 |
+
username = gr.Textbox(
|
| 118 |
+
label="Username to record on leaderboard (should you win)",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
lines=1,
|
| 120 |
max_lines=1,
|
| 121 |
value="",
|
| 122 |
)
|
| 123 |
+
current_fen = gr.Textbox(
|
| 124 |
+
label="Board FEN",
|
| 125 |
+
lines=1,
|
| 126 |
+
max_lines=1,
|
| 127 |
+
value=chess.STARTING_FEN,
|
| 128 |
+
)
|
| 129 |
+
current_pgn = gr.Textbox(
|
| 130 |
+
label="Action sequence",
|
| 131 |
+
lines=1,
|
| 132 |
+
value="",
|
| 133 |
+
)
|
| 134 |
+
with gr.Row():
|
| 135 |
+
move_to_play = gr.Textbox(
|
| 136 |
+
label="Move to play (UCI)",
|
| 137 |
+
lines=1,
|
| 138 |
+
max_lines=1,
|
| 139 |
+
value="",
|
| 140 |
+
)
|
| 141 |
+
play_button = gr.Button("Play")
|
| 142 |
+
with gr.Column():
|
| 143 |
+
image_board = gr.Image(label="Board")
|
| 144 |
|
| 145 |
static_inputs = [
|
| 146 |
username,
|