Download tests/test_catalog.py from windows2t2/cad-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.97 kB
-
https://huggingface.co/windows2t2/cad-bench/resolve/main/tests/test_catalog.py
- Command line
-
hf download hf://windows2t2/cad-bench/tests/test_catalog.py
-
curl -L -o test_catalog.py https://huggingface.co/windows2t2/cad-bench/resolve/main/tests/test_catalog.py
1.97 kB
| from __future__ import annotations | |
| from typing import Any | |
| import autocad_bench.orchestration.catalog as catalog_module | |
| from autocad_bench.orchestration.catalog import query_aws_model_catalog | |
| def test_catalog_reports_exact_absence_and_same_vendor_candidates(monkeypatch) -> None: | |
| monkeypatch.setattr( | |
| catalog_module, | |
| "list_mantle_models", | |
| lambda *_args, **_kwargs: { | |
| "moonshotai.kimi-k2.5", | |
| "zai.glm-5", | |
| }, | |
| ) | |
| class Bedrock: | |
| def list_foundation_models(self): | |
| return { | |
| "modelSummaries": [ | |
| { | |
| "modelId": "moonshotai.kimi-k2.5", | |
| "modelName": "Kimi K2.5", | |
| "inputModalities": ["TEXT", "IMAGE"], | |
| "outputModalities": ["TEXT"], | |
| "modelLifecycle": {"status": "ACTIVE"}, | |
| }, | |
| { | |
| "modelId": "zai.glm-5", | |
| "modelName": "GLM 5", | |
| "inputModalities": ["TEXT"], | |
| "outputModalities": ["TEXT"], | |
| "modelLifecycle": {"status": "ACTIVE"}, | |
| }, | |
| ] | |
| } | |
| class Session: | |
| def client(self, service: str, **_: Any): | |
| assert service == "bedrock" | |
| return Bedrock() | |
| report = query_aws_model_catalog( | |
| profile_name="test-profile", | |
| region_name="us-east-1", | |
| requested_models=["moonshotai/kimi-k3", "z-ai/glm-5"], | |
| session=Session(), | |
| ) | |
| kimi, glm = report["requested_models"] | |
| assert kimi["available_exactly"] is False | |
| assert kimi["same_vendor_candidates"][0]["model_id"] == "moonshotai.kimi-k2.5" | |
| assert kimi["same_vendor_candidates"][0]["input_modalities"] == ["TEXT", "IMAGE"] | |
| assert glm["available_exactly"] is True | |
| assert glm["matching_aws_ids"] == ["zai.glm-5"] | |