Skip to content

Commit d3b1e3e

Browse files
tbitcsoz-agent
andcommitted
fix: mypy errors in hf_sync.py (no-any-return, dict-item types)
Co-Authored-By: Oz <oz-agent@warp.dev>
1 parent 9270ff9 commit d3b1e3e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/specsmith/agent/hf_sync.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ def load_cached_scores(project_dir: str | Path = ".") -> dict[str, Any]:
5353
if not path.is_file():
5454
return {}
5555
try:
56-
return json.loads(path.read_text(encoding="utf-8"))
56+
result: dict[str, Any] = json.loads(path.read_text(encoding="utf-8"))
57+
return result
5758
except (OSError, ValueError):
5859
return {}
5960

@@ -78,7 +79,8 @@ def fetch_hf_model_info(model_id: str, timeout: int = 10) -> dict[str, Any]:
7879
try:
7980
req = urllib.request.Request(url, headers={"Accept": "application/json"})
8081
with urllib.request.urlopen(req, timeout=timeout) as resp: # noqa: S310
81-
return json.loads(resp.read())
82+
result: dict[str, Any] = json.loads(resp.read())
83+
return result
8284
except Exception: # noqa: BLE001
8385
return {}
8486

@@ -116,7 +118,7 @@ def sync_scores(
116118
project_dir: str | Path = ".",
117119
models: list[str] | None = None,
118120
timeout: int = 10,
119-
) -> dict[str, dict[str, float]]:
121+
) -> dict[str, Any]:
120122
"""Sync model scores from HuggingFace.
121123
122124
For HF-hosted models, fetches real benchmark data from model cards.
@@ -127,7 +129,7 @@ def sync_scores(
127129
from specsmith.agent.model_intelligence import BASELINE_SCORES
128130

129131
target_models = models or TRACKED_MODELS
130-
all_scores: dict[str, dict[str, float]] = {}
132+
all_scores: dict[str, Any] = {}
131133

132134
for model_id in target_models:
133135
# For non-HF models, use baseline scores

0 commit comments

Comments
 (0)