File size: 629 Bytes
e2f6db9
 
 
 
0fda9fd
8692672
0fda9fd
 
 
 
 
e2f6db9
 
1
2
3
4
5
6
7
8
9
10
11
12
13
FROM python:3.9
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create cache directory and set permissions
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Set Hugging Face cache directory
ENV HF_HOME=/app/cache
# Pre-download the model to avoid runtime download issues
RUN python -c "from transformers import AutoTokenizer, AutoModelForMaskedLM; AutoTokenizer.from_pretrained('microsoft/codebert-base-mlm'); AutoModelForMaskedLM.from_pretrained('microsoft/codebert-base-mlm')"
COPY . .
EXPOSE 8501
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]