[PR-734] Use Method signature for local-runner#718
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new patch_version method to the Model class and integrates method signatures into the local runner workflow. The changes enable updating existing model versions with method signatures and configuration updates rather than always creating new versions.
- Adds a
patch_versionmethod to the Model class for updating existing model versions - Updates the local runner to include method signatures when creating or updating model versions
- Refactors ModelBuilder instantiation to occur earlier in the local runner flow
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| clarifai/client/model.py | Adds new patch_version method for updating model versions with kwargs |
| clarifai/cli/model.py | Integrates method signatures into model version creation/updating and moves ModelBuilder instantiation |
| model_version=dict(id=response.model.model_version.id), | ||
| ) | ||
|
|
||
| def patch_version(self, version_id: str, **kwargs) -> None: |
There was a problem hiding this comment.
The return type annotation is 'None' but the method actually returns a Model instance (line 2133-2137). The return type should be 'Model' to match the actual behavior.
| def patch_version(self, version_id: str, **kwargs) -> None: | |
| def patch_version(self, version_id: str, **kwargs) -> 'Model': |
| builder = ModelBuilder(model_path, download_validation_only=True) | ||
|
|
||
| validate_context(ctx) | ||
| logger.info("Checking setup for local runner...") |
There was a problem hiding this comment.
[nitpick] The ModelBuilder is instantiated early but only used later in the function. Consider moving this instantiation closer to where it's first used (around line 695) to improve code readability and reduce the scope of the variable.
| builder = ModelBuilder(model_path, download_validation_only=True) | |
| validate_context(ctx) | |
| logger.info("Checking setup for local runner...") | |
| validate_context(ctx) | |
| logger.info("Checking setup for local runner...") | |
| builder = ModelBuilder(model_path, download_validation_only=True) |
Minimum allowed line rate is |
### Why Temperature rather than 1.0 has been deprecated for gpt-5 models
Pull Request Overview
This PR introduces a new
patch_versionmethod to the Model class and integrates method signatures into the local runner workflow. The changes enable updating existing model versions with method signatures and configuration updates rather than always creating new versions.patch_versionmethod to the Model class for updating existing model versions