Get a model adapter for a model_path.
(model_path: str)
| 53 | |
| 54 | @cache |
| 55 | def get_model_adapter(model_path: str) -> BaseAdapter: |
| 56 | """Get a model adapter for a model_path.""" |
| 57 | for adapter in model_adapters: |
| 58 | if adapter.match(model_path): |
| 59 | return adapter |
| 60 | raise ValueError(f"No valid model adapter for {model_path}") |
| 61 | |
| 62 | |
| 63 | def raise_warning_for_incompatible_cpu_offloading_configuration( |
no test coverage detected