Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -10
Dockerfile
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
-
# Dùng base image mặc định của Space
|
2 |
FROM python:3.10
|
3 |
|
4 |
-
# Cài đặt các gói hệ thống cần thiết
|
5 |
RUN apt-get update && apt-get install -y \
|
6 |
git \
|
7 |
git-lfs \
|
@@ -13,22 +11,18 @@ RUN apt-get update && apt-get install -y \
|
|
13 |
libgl1-mesa-glx \
|
14 |
&& rm -rf /var/lib/apt/lists/*
|
15 |
|
16 |
-
# Thiết lập thư mục làm việc
|
17 |
WORKDIR /home/user/app
|
18 |
|
19 |
-
# Cài đặt pip mới nhất
|
20 |
RUN pip install --no-cache-dir pip -U
|
21 |
|
22 |
-
#
|
23 |
-
RUN pip install --no-cache-dir --force-reinstall torch==2.
|
24 |
-
RUN pip install --no-cache-dir --force-reinstall transformers
|
25 |
|
26 |
-
# Cài các gói còn lại
|
27 |
COPY requirements.txt .
|
28 |
RUN pip install --no-cache-dir -r requirements.txt
|
29 |
|
30 |
-
# Copy app.py
|
31 |
COPY app.py .
|
32 |
|
33 |
-
# Chạy ứng dụng
|
34 |
CMD ["python", "app.py"]
|
|
|
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
3 |
RUN apt-get update && apt-get install -y \
|
4 |
git \
|
5 |
git-lfs \
|
|
|
11 |
libgl1-mesa-glx \
|
12 |
&& rm -rf /var/lib/apt/lists/*
|
13 |
|
|
|
14 |
WORKDIR /home/user/app
|
15 |
|
|
|
16 |
RUN pip install --no-cache-dir pip -U
|
17 |
|
18 |
+
# Cài torch và transformers trước với force-reinstall
|
19 |
+
RUN pip install --no-cache-dir --force-reinstall torch==2.2.0
|
20 |
+
RUN pip install --no-cache-dir --force-reinstall transformers==4.38.2
|
21 |
|
22 |
+
# Cài các gói còn lại
|
23 |
COPY requirements.txt .
|
24 |
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
|
|
|
26 |
COPY app.py .
|
27 |
|
|
|
28 |
CMD ["python", "app.py"]
|