-
Notifications
You must be signed in to change notification settings - Fork 11
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
Migrate to pydantic>=2.5
, torch==2.1.1
, ray[default]>=2.9
#534
Conversation
9811603
to
df9c886
Compare
- various migration upgrades to ModelSpec and other dataclasses with new pydantic `field_validator` syntax
df9c886
to
32a988e
Compare
@@ -151,22 +149,42 @@ class FunctionSignature: | |||
method: str | |||
"""Class method name. (e.g. forward, __call__ etc)""" | |||
|
|||
init_args: Tuple[Any, ...] = field(default_factory=tuple) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] might be good to validate method != None
? same for func_or_cls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is already handled in the new pydantic validation
@@ -237,7 +237,7 @@ def _get_actor_options(cls, spec: ModelSpec, deployment: ModelDeploymentSpec) -> | |||
|
|||
if spec.runtime_env is not None: | |||
logger.debug("Using custom runtime environment, this may take a while to build.") | |||
actor_opts["runtime_env"] = RuntimeEnv(**asdict(spec.runtime_env)) | |||
actor_opts["runtime_env"] = RuntimeEnv(**spec.runtime_env.model_dump()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
@@ -238,7 +238,7 @@ def txt2img(self, texts: str) -> Image.Image: | |||
|
|||
# Image generation (txt2img) | |||
txt2img_signature = FunctionSignature( | |||
Custom, | |||
func_or_cls=Custom, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'func_or_class' is kind of a confusing name given that we also have method.
Depends on `0.2.0` release autonomi-ai/nos#534
Summary
pydantic>2.5
upgrade2.9
for pydantic>2 update: [ray serve] incompatibility with pydantic >=2.0 ray-project/ray#39722agi-pack
withpydantic>2
support: Migrate topydantic>=2.5
spillai/agi-pack#16field_validator
syntaxRelated issues
#220
Checks
make lint
: I've runmake lint
to lint the changes in this PR.make test
: I've made sure the tests (make test-cpu
ormake test
) are passing.