Spaces:
Sleeping
Sleeping
Pin Gradio to 4.44.0 for HF Spaces compatibility, fix Timer updates
Browse files- .gitignore +21 -0
- README.md +1 -1
- app.py +3 -3
- requirements.txt +1 -1
.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Compiled Python
|
| 2 |
+
__pycache__/
|
| 3 |
+
*.py[cod]
|
| 4 |
+
*$py.class
|
| 5 |
+
|
| 6 |
+
# IDE
|
| 7 |
+
.idea/
|
| 8 |
+
.vscode/
|
| 9 |
+
*.swp
|
| 10 |
+
*.swo
|
| 11 |
+
|
| 12 |
+
# Stockfish binary and source (HF will use packages.txt to install stockfish)
|
| 13 |
+
stockfish/
|
| 14 |
+
*.exe
|
| 15 |
+
|
| 16 |
+
# Output files
|
| 17 |
+
.output.txt
|
| 18 |
+
|
| 19 |
+
# Virtual environments
|
| 20 |
+
venv/
|
| 21 |
+
.env/
|
README.md
CHANGED
|
@@ -4,7 +4,7 @@ emoji: ♟️
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
-
sdk_version:
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: gradio
|
| 7 |
+
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
app.py
CHANGED
|
@@ -1394,7 +1394,7 @@ with gr.Blocks(title="Cascade Lattice Chess") as demo:
|
|
| 1394 |
global game_state
|
| 1395 |
game_state.auto_mode = not game_state.auto_mode
|
| 1396 |
return (
|
| 1397 |
-
gr.
|
| 1398 |
render_game(game_state),
|
| 1399 |
get_status_text(),
|
| 1400 |
get_info_text()
|
|
@@ -1402,7 +1402,7 @@ with gr.Blocks(title="Cascade Lattice Chess") as demo:
|
|
| 1402 |
|
| 1403 |
def sync_timer():
|
| 1404 |
"""Sync timer state with game state"""
|
| 1405 |
-
return gr.
|
| 1406 |
|
| 1407 |
# Event handlers - image clicks handle everything now
|
| 1408 |
game_image.select(process_click, inputs=[game_image], outputs=[game_image, status])
|
|
@@ -1411,7 +1411,7 @@ with gr.Blocks(title="Cascade Lattice Chess") as demo:
|
|
| 1411 |
auto_timer.tick(auto_play_tick, outputs=[game_image, status, info])
|
| 1412 |
|
| 1413 |
# Sync timer when image updates (in case auto toggled via in-panel click)
|
| 1414 |
-
game_image.change(lambda: (get_info_text(), gr.
|
| 1415 |
|
| 1416 |
# Initialize game on page load
|
| 1417 |
def on_load():
|
|
|
|
| 1394 |
global game_state
|
| 1395 |
game_state.auto_mode = not game_state.auto_mode
|
| 1396 |
return (
|
| 1397 |
+
gr.update(active=game_state.auto_mode),
|
| 1398 |
render_game(game_state),
|
| 1399 |
get_status_text(),
|
| 1400 |
get_info_text()
|
|
|
|
| 1402 |
|
| 1403 |
def sync_timer():
|
| 1404 |
"""Sync timer state with game state"""
|
| 1405 |
+
return gr.update(active=game_state.auto_mode)
|
| 1406 |
|
| 1407 |
# Event handlers - image clicks handle everything now
|
| 1408 |
game_image.select(process_click, inputs=[game_image], outputs=[game_image, status])
|
|
|
|
| 1411 |
auto_timer.tick(auto_play_tick, outputs=[game_image, status, info])
|
| 1412 |
|
| 1413 |
# Sync timer when image updates (in case auto toggled via in-panel click)
|
| 1414 |
+
game_image.change(lambda: (get_info_text(), gr.update(active=game_state.auto_mode)), outputs=[info, auto_timer])
|
| 1415 |
|
| 1416 |
# Initialize game on page load
|
| 1417 |
def on_load():
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio
|
| 2 |
chess
|
| 3 |
torch
|
| 4 |
transformers
|
|
|
|
| 1 |
+
gradio==4.44.0
|
| 2 |
chess
|
| 3 |
torch
|
| 4 |
transformers
|