GopalKrushnaMahapatra commited on
Commit
5e76a95
·
verified ·
1 Parent(s): da2ddf0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,8 +1,7 @@
1
- # 1. Use Python 3.11 (Required by the new GECToR library)
2
  FROM python:3.11-slim
3
 
4
  # 2. Install System Tools & Java 21
5
- # We use openjdk-21 because this base image is Debian 13 (Trixie)
6
  RUN apt-get update && \
7
  apt-get install -y \
8
  git \
@@ -25,26 +24,28 @@ ENV TRANSFORMERS_CACHE=/app/cache
25
  ENV HF_HOME=/app/cache
26
  RUN mkdir -p /app/cache && chmod 777 /app/cache
27
 
28
- # 5. Install Dependencies (From your cleaned requirements.txt)
29
  COPY requirements.txt .
30
  RUN pip install --no-cache-dir --upgrade pip && \
31
  pip install --no-cache-dir -r requirements.txt
32
 
33
  # 6. INSTALL GECToR LIBRARY
34
- # We clone the library and let pip resolve dependencies automatically
35
  RUN git clone https://github.com/gotutiyan/gector.git /app/gector_lib
36
  RUN pip install --no-cache-dir /app/gector_lib
37
 
38
- # 7. SETUP DATA & MODEL
39
  RUN mkdir -p /app/data
40
- # Download the heavy model weights
41
- RUN wget -O /app/data/gector_model.th https://huggingface.co/gotutiyan/gector-roberta-base-5k/resolve/main/pytorch_model.bin
 
 
 
 
 
 
42
 
43
  # 8. Copy App Code
44
  COPY . .
45
 
46
- # 9. Move vocab file (if uploaded to root)
47
- RUN mv verb-form-vocab.txt /app/data/verb-form-vocab.txt || echo "File not found in root, skipping move"
48
-
49
- # 10. Run App
50
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # 1. Use Python 3.11 (Required for GECToR)
2
  FROM python:3.11-slim
3
 
4
  # 2. Install System Tools & Java 21
 
5
  RUN apt-get update && \
6
  apt-get install -y \
7
  git \
 
24
  ENV HF_HOME=/app/cache
25
  RUN mkdir -p /app/cache && chmod 777 /app/cache
26
 
27
+ # 5. Install Dependencies
28
  COPY requirements.txt .
29
  RUN pip install --no-cache-dir --upgrade pip && \
30
  pip install --no-cache-dir -r requirements.txt
31
 
32
  # 6. INSTALL GECToR LIBRARY
 
33
  RUN git clone https://github.com/gotutiyan/gector.git /app/gector_lib
34
  RUN pip install --no-cache-dir /app/gector_lib
35
 
36
+ # 7. SETUP DATA (Force Fresh Download)
37
  RUN mkdir -p /app/data
38
+
39
+ # Force cache break using date (Ensures we actually download the files)
40
+ RUN echo "Downloading Model Weights..." && \
41
+ wget -O /app/data/gector_model.th https://huggingface.co/gotutiyan/gector-roberta-base-5k/resolve/main/pytorch_model.bin
42
+
43
+ # Download Vocab file directly (Fixes the 'No such file' error)
44
+ RUN echo "Downloading Vocab File..." && \
45
+ wget -O /app/data/verb-form-vocab.txt https://github.com/grammarly/gector/raw/master/data/vocabulary/verb-form-vocab.txt
46
 
47
  # 8. Copy App Code
48
  COPY . .
49
 
50
+ # 9. Run App
 
 
 
51
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]