marcsun13 HF Staff commited on
Commit
35c770e
·
1 Parent(s): 9266b58

correct the versioning note: a version is a branch on the kernel repo, not a tag

Browse files
Files changed (1) hide show
  1. SKILL.md +18 -2
SKILL.md CHANGED
@@ -154,8 +154,24 @@ reports it, except the package's `supports_*` will already have promised it to t
154
  Upload `build/` plus `README.md` (with `tags: [kernel]`), and keep the sources in the repo so it stays
155
  reproducible. Then, in increasing order of surprise:
156
 
157
- 1. **Tag a version.** `get_kernel` refuses an unpinned repo: "A kernel version or revision must be
158
- specified". Create a `v<major>.<minor>.<patch>` tag, load with `version=<major>`.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  2. **Trust.** `get_kernel` loads unattended only from a publisher the Hub marks as a trusted kernel
160
  publisher (e.g. `kernels-community`). A personal repo needs `trust_remote_code=True`, i.e. the
161
  caller opting into running downloaded code — so a library should not pass it silently.
 
154
  Upload `build/` plus `README.md` (with `tags: [kernel]`), and keep the sources in the repo so it stays
155
  reproducible. Then, in increasing order of surprise:
156
 
157
+ 1. **A version is a *branch*, not a tag.** `get_kernel` refuses an unpinned repo ("A kernel version
158
+ or revision must be specified"), but `version=N` resolves by listing refs on the **kernel** repo
159
+ (`repo_type="kernel"`) and matching *branches* named `v<int>` -- see `kernels/_versions.py`,
160
+ `_get_available_versions`. Tags are never read, and the model repo is never consulted. This is
161
+ what `build-and-upload` writes, so **every upload republishes what existing consumers resolve**;
162
+ there is no immutable pin, and freezing one means a new branch (`v2`), not a tag.
163
+
164
+ Two consequences that cost time:
165
+
166
+ - **`build-and-upload` writes only `v1`, leaving the kernel repo's `main` stale** -- and `main` is
167
+ what the Hub page renders, so the backend badge (e.g. the Metal logo) silently disappears or
168
+ goes out of date. After uploading, fast-forward it:
169
+ `git clone https://huggingface.co/kernels/<ns>/<name> && git push -f origin origin/v1:refs/heads/main`
170
+ - **A `v<major>.<minor>.<patch>` tag on the *model* repo is a human marker** of which source
171
+ commit produced a build -- useful, but load-bearing for nobody. Keep it with plain git
172
+ (`git tag -d v1.0.0 && git tag v1.0.0 HEAD && git push -f <hub-remote> refs/tags/v1.0.0`), not
173
+ `HfApi.create_tag`: the API writes only on the Hub and never touches your clone, so the tag your
174
+ editor shows keeps pointing at an old commit while the API cheerfully reports it correct.
175
  2. **Trust.** `get_kernel` loads unattended only from a publisher the Hub marks as a trusted kernel
176
  publisher (e.g. `kernels-community`). A personal repo needs `trust_remote_code=True`, i.e. the
177
  caller opting into running downloaded code — so a library should not pass it silently.