-
Notifications
You must be signed in to change notification settings - Fork 1
fix(models): Update model enum translations for reasoning #20
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3e428ae
ci(publish): Only publish if all the build and tests passed
heliocastro 8cd8847
fix(models): Do proper enum translation for reasoning
heliocastro f62546d
test(models): Update test data
heliocastro a9364a3
chore(version): Bump version
heliocastro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import inspect | ||
|
|
||
| from pydantic import BaseModel | ||
|
|
||
| import ort.models # or your top-level models package | ||
|
|
||
|
|
||
| def iter_models(module): | ||
| for _, obj in inspect.getmembers(module): | ||
| if inspect.isclass(obj) and issubclass(obj, BaseModel): | ||
| yield obj | ||
|
|
||
|
|
||
| for model in iter_models(ort.models): | ||
| try: | ||
| print("Rebuilding:", model) | ||
| model.model_rebuild() | ||
| except Exception: | ||
| print("FAILED:", model) | ||
| raise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # SPDX-FileCopyrightText: 2026 Helio Chissini de Castro <heliocastro@gmail.com> | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
| import yaml | ||
| from pydantic import ValidationError | ||
|
|
||
| from ort.models.config.repository_configuration import RepositoryConfiguration | ||
|
|
||
| REPO_CONFIG_DIR = Path(__file__).parent / "data" / "repo_config" | ||
|
|
||
| # Collect all YAML files that are expected to be valid RepositoryConfiguration documents | ||
| _VALID_FILES = [f for f in REPO_CONFIG_DIR.glob("*.yml") if f.name != "only_include_reason_fail.yml"] | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("config_file", _VALID_FILES, ids=lambda f: f.name) | ||
| def test_repo_config_file_loads_without_validation_error(config_file: Path) -> None: | ||
| """Each file in tests/data/repo_config (except known-invalid ones) must load | ||
| into RepositoryConfiguration without raising a pydantic ValidationError.""" | ||
| data = yaml.safe_load(config_file.read_text()) | ||
| try: | ||
| RepositoryConfiguration.model_validate(data or {}) | ||
| except ValidationError as exc: | ||
| pytest.fail(f"{config_file.name} raised ValidationError: {exc}") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.