mashaelalbu commited on
Commit
e3be212
·
verified ·
1 Parent(s): 4e0c1bc

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -31
Dockerfile CHANGED
@@ -1,32 +1,35 @@
1
- FROM python:3.10-slim
2
-
3
- ENV PYTHONDONTWRITEBYTECODE=1
4
- ENV PYTHONUNBUFFERED=1
5
- ENV DEBIAN_FRONTEND=noninteractive
6
- ENV MODEL_PATH=RufusRubin777/GOT-OCR2_0_CPU
7
-
8
- WORKDIR /app
9
-
10
- RUN apt-get update && apt-get install -y \
11
- build-essential \
12
- libpq-dev \
13
- && rm -rf /var/lib/apt/lists/*
14
-
15
- COPY requirements.txt .
16
- RUN pip install --no-cache-dir -r requirements.txt
17
-
18
- RUN mkdir -p /root/.cache/huggingface
19
- VOLUME /root/.cache/huggingface
20
-
21
- RUN python -c "from transformers_modules.RufusRubin777.GOT_OCR2_0_CPU.modeling_GOT import GOTModel, GOTConfig; \
22
- from transformers import AutoTokenizer; \
23
- model_path='RufusRubin777/GOT-OCR2_0_CPU'; \
24
- config = GOTConfig.from_pretrained(model_path); \
25
- model = GOTModel.from_pretrained(model_path, config=config); \
26
- tokenizer = AutoTokenizer.from_pretrained(model_path)"
27
-
28
- COPY . .
29
-
30
- EXPOSE 7860
31
-
 
 
 
32
  CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1
4
+ ENV PYTHONUNBUFFERED=1
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
+ ENV MODEL_PATH=RufusRubin777/GOT-OCR2_0_CPU
7
+
8
+ WORKDIR /app
9
+
10
+ RUN apt-get update && apt-get install -y \
11
+ build-essential \
12
+ libpq-dev \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ COPY requirements.txt .
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Download NLTK data
19
+ RUN python -m nltk.downloader punkt punkt_tab
20
+
21
+ RUN mkdir -p /root/.cache/huggingface
22
+ VOLUME /root/.cache/huggingface
23
+
24
+ RUN python -c "from transformers_modules.stepfun-ai.GOT-OCR2_0.modeling_GOT import GOTModel, GOTConfig; \
25
+ from transformers import AutoTokenizer; \
26
+ model_path='stepfun-ai/GOT-OCR2_0'; \
27
+ config = GOTConfig.from_pretrained(model_path); \
28
+ model = GOTModel.from_pretrained(model_path, config=config); \
29
+ tokenizer = AutoTokenizer.from_pretrained(model_path)"
30
+
31
+ COPY . .
32
+
33
+ EXPOSE 7860
34
+
35
  CMD ["python", "app.py"]