Commit 70d7d63
committed
Address the typed models/ URI where the parser maps it
I rejected this the first time Codex raised it, and I was wrong. I checked
REPO_TYPES_URL_PREFIXES on 0.36.2, saw no models/ entry, and concluded the form was
unsupported. It is supported from 1.16, which routes resolve_path through
parse_hf_uri:
1.25.1 resolve_path("models/openai-community/gpt2") -> model openai-community/gpt2
0.36.2 resolve_path("models/openai-community/gpt2") -> FileNotFoundError
So the prefilter was calling an addressable model absent on current releases. That is
the branch's own thesis turned on a shape I introduced, and it is the second time I
have answered a question about resolve_path from the wrong version's constants.
Gated on the parser, not on a version. REPO_TYPES_MAPPING contains models on both
releases so it cannot discriminate, and stripping the prefix unconditionally would be
worse than leaving it: on 0.36.2 that probes org/repo and answers True for an address
that version cannot reach. _hub_addresses_typed_model_uris asks parse_hf_uri directly
and answers False when it is absent.
Deliberately narrow. parse_hf_uri reads models/a/b/c as repo a/b plus file c, and
/abs/base as repo abs/base, so this file keeps its own path rules rather than
delegating them: /models/org/repo, ./models/org/repo, ~/models/org/repo and
models/a/b/c all stay False with the capability forced on. datasets/, spaces/ and
kernels/ resolve too and stay rejected, since none can be the base model of a merge.
Tests assert the classification equals the capability rather than hardcoding either
answer, so they hold across the supported range. Behavioral gate 593 passed, 2 skipped.1 parent ab6e780 commit 70d7d63
2 files changed
Lines changed: 87 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
260 | 307 | | |
261 | 308 | | |
262 | 309 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4516 | 4516 | | |
4517 | 4517 | | |
4518 | 4518 | | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
4519 | 4553 | | |
4520 | 4554 | | |
4521 | 4555 | | |
| |||
4538 | 4572 | | |
4539 | 4573 | | |
4540 | 4574 | | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
4541 | 4581 | | |
4542 | 4582 | | |
4543 | 4583 | | |
| |||
0 commit comments