fix spacy and en_core_web_sm errors
Browse files- 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 |
|