Skip to content

Commit d51aa48

Browse files
ligydshieh
andauthored
Limit Pydantic to V1 in dependencies (#24596)
* Limit Pydantic to V1 in dependencies Pydantic is about to release V2 release which will break a lot of things. This change prevents `transformers` to be used with Pydantic V2 to avoid breaking things. * more --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
1 parent 299aafe commit d51aa48

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

docker/transformers-pytorch-deepspeed-latest-gpu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ RUN DS_BUILD_CPU_ADAM=1 DS_BUILD_FUSED_ADAM=1 DS_BUILD_UTILS=1 python3 -m pip in
5050
RUN cd transformers && python3 setup.py develop
5151

5252
# The base image ships with `pydantic==1.8.2` which is not working - i.e. the next command fails
53-
RUN python3 -m pip install -U --no-cache-dir pydantic
53+
RUN python3 -m pip install -U --no-cache-dir pydantic<2
5454
RUN python3 -c "from deepspeed.launcher.runner import main"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
"protobuf",
146146
"psutil",
147147
"pyyaml>=5.1",
148-
"pydantic",
148+
"pydantic<2",
149149
"pytest>=7.2.0",
150150
"pytest-timeout",
151151
"pytest-xdist",

src/transformers/dependency_versions_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"protobuf": "protobuf",
5151
"psutil": "psutil",
5252
"pyyaml": "pyyaml>=5.1",
53-
"pydantic": "pydantic",
53+
"pydantic": "pydantic<2",
5454
"pytest": "pytest>=7.2.0",
5555
"pytest-timeout": "pytest-timeout",
5656
"pytest-xdist": "pytest-xdist",

0 commit comments

Comments
 (0)