Commit 63898f1
fix: simplify _download_from_gcs parameter list via dataclass
Refactored `_download_from_gcs` to use the `model` description object as a configuration object instead of passing individual fields. This reduces the parameter count and improves maintainability by leveraging existing data structures.
Changes:
- Updated `_download_from_gcs` signature to `(cls, model: T, cache_dir: str, **kwargs: Any)`.
- Updated call site in `download_model`.
- Updated corresponding unit tests in `tests/test_model_management.py`.
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent 786423e commit 63898f1
2 files changed
Lines changed: 12 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
601 | 601 | | |
602 | 602 | | |
603 | 603 | | |
604 | | - | |
605 | | - | |
| 604 | + | |
606 | 605 | | |
607 | | - | |
608 | | - | |
| 606 | + | |
609 | 607 | | |
| 608 | + | |
| 609 | + | |
610 | 610 | | |
611 | 611 | | |
612 | | - | |
| 612 | + | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | 618 | | |
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
688 | | - | |
| 687 | + | |
689 | 688 | | |
690 | | - | |
691 | | - | |
| 689 | + | |
692 | 690 | | |
693 | 691 | | |
694 | 692 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
| 1237 | + | |
1237 | 1238 | | |
1238 | | - | |
1239 | | - | |
| 1239 | + | |
1240 | 1240 | | |
1241 | | - | |
1242 | 1241 | | |
1243 | 1242 | | |
1244 | 1243 | | |
| |||
1253 | 1252 | | |
1254 | 1253 | | |
1255 | 1254 | | |
| 1255 | + | |
1256 | 1256 | | |
1257 | | - | |
1258 | | - | |
| 1257 | + | |
1259 | 1258 | | |
1260 | | - | |
1261 | 1259 | | |
1262 | 1260 | | |
1263 | 1261 | | |
| |||
0 commit comments