Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce pydantic_v1 compatibility module for pydantic>=2.0.0 support #4407

Merged

Conversation

ringohoffman
Copy link
Contributor

@ringohoffman ringohoffman commented Sep 27, 2023

Alternate to #3902
Related: microsoft/DeepSpeed-MII#240

Inspired by LangChain's solution: https://github.com/langchain-ai/langchain/blob/64385c4eae4a4b8c27e73b09018f344f0b791f31/libs/langchain/langchain/pydantic_v1/__init__.py#L14-L17

deepspeed can unpin pydantic, but instead of using the new pydantic v2 features, deepspeed can use v2's alias for the v1 API in order to allow greater flexibility for deepspeed users by allowing them to use either pydantic v1 or v2

Instead of upgrading deepspeed to pydantic v2, deepspeed can use pydantic v2's alias for the v1 API in order to unpin pydantic and allow greater flexibility for deepspeed users
@ringohoffman
Copy link
Contributor Author

@microsoft-github-policy-service agree company="Protopia AI"

@mrwyattii mrwyattii marked this pull request as ready for review October 6, 2023 17:10
@mrwyattii mrwyattii merged commit 604d701 into microsoft:master Oct 9, 2023
13 of 15 checks passed
@ringohoffman ringohoffman deleted the pydantic-compatibility-module branch October 9, 2023 19:03
mauryaavinash95 pushed a commit to mauryaavinash95/DeepSpeed that referenced this pull request Oct 9, 2023
microsoft#4407)

* Introduce pydantic_v1 compatibility module for pydantic>=2.0.0 support
@ringohoffman
Copy link
Contributor Author

@mrwyattii thank you so much for reviewing and merging! Can you release a patch including this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants