Really-Amazing commited on
Commit
6f753ea
·
verified ·
1 Parent(s): 6eb4e1c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,27 +1,28 @@
1
- # Use slim base for smaller size on free CPU tier
2
  FROM python:3.10-slim
3
 
4
- # Install minimal build tools only if any C extensions are needed (nanochat is mostly pure torch/Python)
5
  RUN apt-get update && apt-get install -y --no-install-recommends \
6
- build-essential git curl \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
  WORKDIR /app
10
 
11
- # Copy requirements first for better caching
 
 
 
 
 
 
 
12
  COPY requirements.txt .
13
  RUN pip install --no-cache-dir -r requirements.txt \
14
  && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
15
 
16
- # Copy the rest of your project (nanochat/, weights, app.py, etc.)
17
  COPY . .
18
 
19
- # Clean up pip cache to save space
20
- RUN pip cache purge
21
-
22
- # Gradio defaults
23
  EXPOSE 7860
24
  ENV GRADIO_SERVER_NAME="0.0.0.0"
25
 
26
- # Run the app
27
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ # We NEED rustc and cargo to build the tokenizer
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ build-essential git curl rustc cargo \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
  WORKDIR /app
9
 
10
+ # 1. Clone the missing rustbpe source directly into the container
11
+ RUN git clone https://github.com/karpathy/rustbpe.git
12
+
13
+ # 2. Install maturin and build the rustbpe package
14
+ RUN pip install --no-cache-dir maturin \
15
+ && cd rustbpe && maturin develop --release
16
+
17
+ # 3. Install the rest of the requirements
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt \
20
  && pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
21
 
22
+ # Copy your project files
23
  COPY . .
24
 
 
 
 
 
25
  EXPOSE 7860
26
  ENV GRADIO_SERVER_NAME="0.0.0.0"
27
 
 
28
  CMD ["python", "app.py"]