nontGcob commited on
Commit
0bc101b
·
1 Parent(s): 3686966

fix spacy and en_core_web_sm errors

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -0
Dockerfile CHANGED
@@ -9,6 +9,10 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
  # Install spaCy model
10
  RUN python -m spacy download en_core_web_sm
11
 
 
 
 
 
12
  # Copy the local en_core_web_sm-3.0.0.tar.gz file into the container
13
  # COPY ./en_core_web_sm-3.0.0.tar.gz /models/en_core_web_sm-3.0.0.tar.gz
14
 
 
9
  # Install spaCy model
10
  RUN python -m spacy download en_core_web_sm
11
 
12
+ # Patch SpaCy to use Pydantic v1 in case v2 is installed
13
+ RUN sed -i 's/from pydantic import ConstrainedStr/from pydantic.v1 import ConstrainedStr/' \
14
+ /usr/local/lib/python3.10/site-packages/spacy/schemas.py
15
+
16
  # Copy the local en_core_web_sm-3.0.0.tar.gz file into the container
17
  # COPY ./en_core_web_sm-3.0.0.tar.gz /models/en_core_web_sm-3.0.0.tar.gz
18