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

Bug: Removal of mii.pydantic_v1 broke entrypoint scripts #543

Open
KMouratidis opened this issue Nov 11, 2024 · 1 comment
Open

Bug: Removal of mii.pydantic_v1 broke entrypoint scripts #543

KMouratidis opened this issue Nov 11, 2024 · 1 comment

Comments

@KMouratidis
Copy link

When trying to run either of the entrypoint scripts, the following line in the mii/entrypoints/data_models.py file causes an import error:

from mii.pydantic_v1 import BaseModel, BaseSettings, Field

Restoring the file fixes the issue, but I guess that's not a solution. Another option is to:

  1. Install pydantic-settings and change that line to:
from pydantic import BaseModel, Field, ConfigDict
from pydantic_settings import BaseSettings
  1. Since pydantic now has the model_ namespace protected, about 10 classes need to have model_config = ConfigDict(protected_namespaces=()) (or similar) added to them, namely the ChatCompletion*, TokenCheckRequestItem, Embeddings*,Completion*, and AppSettings.
  2. AppSettings.model_id needs to marked as Optional[str] since it is not passed on initialization (see here and here)

I only tested with the openai_api_server.py script.

@KMouratidis
Copy link
Author

Restoring the file does not work because pydantic.v1.BaseModel causes the server to throw 422 errors. I guess the only option is to update the file 😕

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

No branches or pull requests

1 participant