File size: 1,065 Bytes
42844de
 
 
 
f62dc29
42844de
f62dc29
42844de
6f753ea
f62dc29
1702c1d
e9e19db
 
f62dc29
1702c1d
 
f62dc29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1702c1d
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM python:3.10-slim

WORKDIR /app

# Install build tools for Rust-based components
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential curl git rustc cargo \
    && rm -rf /var/lib/apt/lists/*

# Install python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy all files from your repo root to /app
COPY . .

# --- THE CRITICAL FIX ---
# Nanochat looks for these in a specific hidden path. 
# We create that path and copy your uploaded files there.
RUN mkdir -p /root/.cache/nanochat/tokenizer/ && \
    cp tokenizer.pkl /root/.cache/nanochat/tokenizer/tokenizer.pkl && \
    cp token_bytes.pt /root/.cache/nanochat/tokenizer/token_bytes.pt

# Ensure the Hugging Face 'user' (UID 1000) can also see them
RUN mkdir -p /.cache/nanochat/tokenizer/ && \
    cp tokenizer.pkl /.cache/nanochat/tokenizer/tokenizer.pkl && \
    cp token_bytes.pt /.cache/nanochat/tokenizer/token_bytes.pt && \
    chmod -R 777 /.cache

EXPOSE 7860
ENV GRADIO_SERVER_NAME="0.0.0.0"

CMD ["python", "app.py"]