longjava2024 commited on
Commit
c67c2e9
·
verified ·
1 Parent(s): fd7ebeb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -9
Dockerfile CHANGED
@@ -1,20 +1,30 @@
1
- FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- RUN apt-get update && apt-get install -y \
 
 
 
6
  git \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- RUN pip install --no-cache-dir \
11
- fastapi \
12
- uvicorn \
13
- torch \
14
- transformers \
15
- accelerate \
16
- bitsandbytes
 
 
 
 
 
17
 
18
  COPY app.py /app/app.py
19
 
 
 
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
2
 
3
  WORKDIR /app
4
 
5
+ ENV PYTHONUNBUFFERED=1 \
6
+ HF_HUB_DISABLE_SYMLINKS_WARNING=1
7
+
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
  git \
10
  build-essential \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ RUN pip install --no-cache-dir --upgrade pip && \
14
+ pip install --no-cache-dir \
15
+ fastapi \
16
+ uvicorn[standard] \
17
+ "huggingface-hub>=0.23.2" \
18
+ "transformers==4.44.2" \
19
+ accelerate \
20
+ bitsandbytes \
21
+ torchvision \
22
+ pillow \
23
+ requests \
24
+ flash-attn --no-build-isolation
25
 
26
  COPY app.py /app/app.py
27
 
28
+ EXPOSE 7860
29
+
30
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]