czakop commited on
Commit
7860c23
·
1 Parent(s): e6572e5

change sdk to docker

Browse files
Files changed (4) hide show
  1. Dockerfile +16 -0
  2. README.md +2 -6
  3. app.py +1 -1
  4. postBuild +0 -9
Dockerfile ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y git stockfish make git && \
5
+ rm -rf /var/lib/apt/lists/*
6
+
7
+ COPY requirements.txt .
8
+ RUN pip install --no-cache-dir -r requirements.txt
9
+
10
+ RUN git clone https://github.com/lichess-org/chess-openings.git /app/data/lichess_openings && \
11
+ cd /app/data/lichess_openings && \
12
+ make
13
+
14
+ COPY . /app
15
+ WORKDIR /app
16
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -1,14 +1,10 @@
1
  ---
2
  title: Chess Agent Mcp
3
- emoji: 📉
4
  colorFrom: yellow
5
  colorTo: green
6
- sdk: gradio
7
- sdk_version: 5.33.0
8
- app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
  short_description: MCP server providing useful tools for chess agents
12
  ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
  title: Chess Agent Mcp
3
+ emoji: ♟️
4
  colorFrom: yellow
5
  colorTo: green
6
+ sdk: docker
 
 
7
  pinned: false
8
  license: apache-2.0
9
  short_description: MCP server providing useful tools for chess agents
10
  ---
 
 
app.py CHANGED
@@ -1077,7 +1077,7 @@ def _get_attackers(board: chess.Board, square: chess.Square, color: chess.Color)
1077
 
1078
 
1079
  def _load_lichess_openings(
1080
- path_prefix: str = "data/lichess_openings/dist/",
1081
  ) -> pd.DataFrame:
1082
  """Load Lichess openings data from TSV files.
1083
  Assumes files 'a.tsv', 'b.tsv', 'c.tsv', 'd.tsv', 'e.tsv' are in path_prefix.
 
1077
 
1078
 
1079
  def _load_lichess_openings(
1080
+ path_prefix: str = "/app/data/lichess_openings/dist/",
1081
  ) -> pd.DataFrame:
1082
  """Load Lichess openings data from TSV files.
1083
  Assumes files 'a.tsv', 'b.tsv', 'c.tsv', 'd.tsv', 'e.tsv' are in path_prefix.
postBuild DELETED
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -e
3
-
4
- # 1. Clone the Lichess openings TSV dataset
5
- git clone https://github.com/lichess-org/chess-openings.git data/lichess_openings
6
-
7
- # 2. Build/prep with make
8
- cd data/lichess_openings
9
- make