GopalKrushnaMahapatra commited on
Commit
e7d6b5a
·
verified ·
1 Parent(s): 2049c18

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -20
Dockerfile CHANGED
@@ -21,32 +21,22 @@ ENV TRANSFORMERS_CACHE=/app/cache
21
  ENV HF_HOME=/app/cache
22
  RUN mkdir -p /app/cache && chmod 777 /app/cache
23
 
24
- # 4. Install Dependencies
25
  COPY requirements.txt .
26
  RUN pip install --no-cache-dir --upgrade pip && \
27
  pip install --no-cache-dir -r requirements.txt
28
 
29
- # 5. Install GECToR Library
30
- RUN git clone https://github.com/gotutiyan/gector.git /app/gector_lib
31
- RUN pip install --no-cache-dir /app/gector_lib
32
-
33
- # 6. SETUP DATA
34
  RUN mkdir -p /app/data
35
 
36
- # A. The Heavy Model (Must download)
37
- RUN echo "Downloading Model Weights..." && \
38
- wget -O /app/data/gector_model.th https://huggingface.co/gotutiyan/gector-roberta-base-5k/resolve/main/pytorch_model.bin
39
-
40
- # B. The MISSING Vocab Files ONLY
41
- # We download labels.txt and d_tags.txt because they are missing.
42
- # We DO NOT download verb-form-vocab.txt because you uploaded it.
43
- RUN echo "Downloading Missing Vocab Files..." && \
44
- wget -O /app/data/labels.txt https://github.com/grammarly/gector/raw/master/data/output_vocabulary/labels.txt && \
45
- wget -O /app/data/d_tags.txt https://github.com/grammarly/gector/raw/master/data/output_vocabulary/d_tags.txt
46
 
47
- # 7. Copy App Code
48
- # This command copies your uploaded 'verb-form-vocab.txt' into /app/data
49
  COPY . .
50
 
51
- # 8. Run App
52
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
21
  ENV HF_HOME=/app/cache
22
  RUN mkdir -p /app/cache && chmod 777 /app/cache
23
 
24
+ # 4. Install Python Dependencies
25
  COPY requirements.txt .
26
  RUN pip install --no-cache-dir --upgrade pip && \
27
  pip install --no-cache-dir -r requirements.txt
28
 
29
+ # 5. Setup data directory
 
 
 
 
30
  RUN mkdir -p /app/data
31
 
32
+ # 5a. Download verb dictionary (needed by GECToR)
33
+ # If you already have this file in your repo, this will just overwrite with same content.
34
+ RUN echo "Downloading verb-form-vocab.txt for GECToR..." && \
35
+ wget -O /app/data/verb-form-vocab.txt \
36
+ https://github.com/grammarly/gector/raw/master/data/verb-form-vocab.txt
 
 
 
 
 
37
 
38
+ # 6. Copy App Code
 
39
  COPY . .
40
 
41
+ # 7. Run App
42
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]