File size: 723 Bytes
bf4d78b
b269ebb
 
 
fc07040
b269ebb
81cc5b7
 
bf4d78b
81cc5b7
cfc05e8
bf4d78b
 
b269ebb
 
 
 
 
bf4d78b
b269ebb
 
bf4d78b
b269ebb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Sử dụng image python slim
FROM python:3.10-slim

# Cài đặt các thư viện cần thiết
RUN pip install --no-cache-dir transformers flask tensorflow tf-keras

# Đặt biến môi trường cho cache (sử dụng HF_HOME thay vì TRANSFORMERS_CACHE)
ENV HF_HOME=/tmp/.cache

# Tải sẵn mô hình PhoBERT từ TensorFlow
RUN python -c "from transformers import TFAutoModel, AutoTokenizer; TFAutoModel.from_pretrained('vinai/phobert-base'); AutoTokenizer.from_pretrained('vinai/phobert-base')"

# Tạo thư mục làm việc trong container
WORKDIR /app

# Copy mã nguồn vào container
COPY . /app

# Expose cổng 7860 để chạy ứng dụng
EXPOSE 7860

# Chạy ứng dụng
CMD ["python", "app.py"]