Publish hf-badges in Lance format
#1
by tsmithv11 - opened
Files changed (14)
- .gitattributes+1
- LICENSEAdded+23
- README.mdAdded+89
- lance/actions.lance/_transactions/0-dff36fc6-f01e-49b3-bf58-15f2cb72e88a.txnAdded
- lance/actions.lance/_versions/18446744073709551614.manifestAdded
- lance/actions.lance/_versions/latest_version_hint.jsonAdded+1
- lance/actions.lance/data/1101001100010011111011116f4d02491f90f07be5f170c554.lanceAdded
- lance/assets.lance/_transactions/0-f3e216c6-0c9a-4a89-aab9-a94e1c5390b3.txnAdded
- lance/assets.lance/_versions/18446744073709551614.manifestAdded
- lance/assets.lance/_versions/latest_version_hint.jsonAdded+1
- lance/assets.lance/data/1011001111100100000110013fc66d4045b833987b8f36d33b.lanceAdded+3
- source/README.mdAdded+259
- source/badges-thumbnail.pngAdded
- viewer/badges.parquetAdded+3
57 unmodified lines58596057 unmodified lines# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -text57 unmodified lines5859606157 unmodified lines# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -textlance/assets.lance/data/1011001111100100000110013fc66d4045b833987b8f36d33b.lance filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617181920212223MIT License
Original badges and their documentation by Hugging Face, published inhuggingface/badges under the MIT license. The upstream dataset card ispreserved in source/README.md.
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889---license: mitpretty_name: Hugging Face Badges in Lancelanguage:- ensize_categories:- n<1Ktags:- lance- badges- svg- image- text-retrievalthumbnail: https://huggingface.co/datasets/lance-format/hf-badges-lance/resolve/main/source/badges-thumbnail.pngconfigs:- config_name: default default: true data_files: - split: train path: viewer/badges.parquet---
# Hugging Face Badges in Lance
Search the official Hugging Face badges by action and retrieve the original artwork by filename. The collection includes badges for sharing a dataset, deploying an app on Spaces, opening a pull request, and using ML Intern. [Original Hugging Face Badges dataset and pinned source revision](https://huggingface.co/datasets/huggingface/badges/tree/05b1d96517868a58a66174409a84b497c413a1bd)
## Data
| Lance table | Rows | Contents || --- | ---: | --- || `lance/assets.lance` | 149 | All original files, including 146 SVG variants, the thumbnail, source card, and Git attributes. Each row stores the original filename, bytes, byte length, and SHA-256 hash. SVG rows include the theme and any source label, target link, or title. || `lance/actions.lance` | 23 | One row per badge action, with its label, the text embedded for search, all filenames for that action, and a retrieval vector. |
The upstream catalog has no train, validation, or test splits. [Data Studio](https://huggingface.co/datasets/lance-format/hf-badges-lance/viewer/default/train) displays a Parquet preview of all 146 SVG variants rendered as PNGs under its default `train` split. The native Lance assets retain the original SVG bytes.
## Search for badge actions
The source provides no embeddings. This release embeds each badge action in English using its source README heading or SVG title and a short description of the intended action, stored in `embedded_text`. Light and dark themes, sizes, and alternate filenames for the same action share one search result. The vectors use the first 256 dimensions of the encoder's Matryoshka representation with L2 normalization. The example uses the same encoder for the query and reports cosine similarity, with higher scores indicating closer matches. [Pinned static retrieval encoder revision](https://huggingface.co/sentence-transformers/static-retrieval-mrl-en-v1/tree/f60985c706f192d45d218078e49e5a8b6f15283a)
```bashpip install pylance==14.0.3 huggingface_hub==2.4.0 sentence-transformers==6.3.0```
```pythonimport lancefrom huggingface_hub import HfApifrom sentence_transformers import SentenceTransformer
repo = "lance-format/hf-badges-lance"root = f"hf://datasets/{repo}"revision = HfApi(token=False).dataset_info(repo, token=False).shastorage_options = {"hf_revision": revision}encoder = SentenceTransformer( "sentence-transformers/static-retrieval-mrl-en-v1", revision="f60985c706f192d45d218078e49e5a8b6f15283a", truncate_dim=256, device="cpu",)query = "Show a badge to deploy my application on Hugging Face Spaces"query_vector = encoder.encode_query(query, normalize_embeddings=True)actions = lance.dataset(f"{root}/lance/actions.lance", storage_options=storage_options)matches = actions.to_table( columns=["action_id", "action", "variant_filenames", "_distance"], nearest={"column": "embedding", "q": query_vector, "k": 5, "metric": "cosine"},).to_pylist()
for match in matches: score = 1 - match["_distance"] filenames = ", ".join(match["variant_filenames"]) print(f"{score:.4f} {match['action_id']} {match['action']} {filenames}")```
To save a badge as an original SVG, select a filename from the matches and read its bytes from the assets table.
```pythonfrom pathlib import Path
filename = matches[0]["variant_filenames"][0]assets = lance.dataset(f"{root}/lance/assets.lance", storage_options=storage_options)asset, = assets.to_table( filter=f"source_path = '{filename}'", columns=["source_bytes"],).to_pylist()Path(filename).write_bytes(asset["source_bytes"])```
## License and attribution
Hugging Face published the original artwork and documentation under the MIT license. This release adds the Lance tables, badge-action search, and PNG previews. [Original dataset card](source/README.md) · [MIT license](LICENSE)1{"version":1}1{"version":1}123version https://git-lfs.github.com/spec/v1oid sha256:8eff5ad4307d92dbde520a0e77bcb23e09bc094cfea0561b124a7c8f722eb5fesize 1455292123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259---license: mitthumbnail: "https://huggingface.co/datasets/huggingface/badges/resolve/main/badges-thumbnail.png"---
<style>.prose img { display: inline; margin: 0 6px !important;}.prose table { max-width: 320px; margin: 0;}</style>
# Badges
A set of badges you can use anywhere. Just update the anchor URL to point to the correct action for your Space. Light or dark background with 4 sizes available: small, medium, large, and extra large.
## How to use?
- With markdown, just copy the badge from: https://huggingface.co/datasets/huggingface/badges/blob/main/README.md?code=true- With HTML, inspect this page with your web browser and copy the outer html.
## Available sizes
| Small | Medium | Large | Extra large | | ------------- | :-----------: | ------------- | ------------- || 20px (height) | 24px (height) | 36px (height) | 48px (height) |
## Use with MCP
[](https://huggingface.co/settings/mcp)[](https://huggingface.co/settings/mcp)
[](https://huggingface.co/settings/mcp)[](https://huggingface.co/settings/mcp)
[](https://huggingface.co/settings/mcp)[](https://huggingface.co/settings/mcp)
[](https://huggingface.co/settings/mcp)[](https://huggingface.co/settings/mcp)
## Follow us on HF
[](https://huggingface.co/organizations)[](https://huggingface.co/organizations)
[](https://huggingface.co/organizations)[](https://huggingface.co/organizations)
[](https://huggingface.co/organizations)[](https://huggingface.co/organizations)
[](https://huggingface.co/organizations)[](https://huggingface.co/organizations)
## Paper page
[](https://huggingface.co/papers)[](https://huggingface.co/papers)
[](https://huggingface.co/papers)[](https://huggingface.co/papers)
[](https://huggingface.co/papers)[](https://huggingface.co/papers)
[](https://huggingface.co/papers)[](https://huggingface.co/papers)
## Deploy on Spaces
[](https://huggingface.co/new-space)[](https://huggingface.co/new-space)
[](https://huggingface.co/new-space)[](https://huggingface.co/new-space)
[](https://huggingface.co/new-space)[](https://huggingface.co/new-space)
[](https://huggingface.co/new-space)[](https://huggingface.co/new-space)
## Duplicate this Space
[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)
[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)
[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)
[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)[](https://huggingface.co/spaces/huggingface-projects/diffusers-gallery?duplicate=true)
## Open in HF Spaces
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
## Open a Discussion
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
## Share to Community
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
[](https://huggingface.co/spaces)[](https://huggingface.co/spaces)
## Sign in with Hugging Face
[](https://huggingface.co/)[](https://huggingface.co/)
[](https://huggingface.co/)[](https://huggingface.co/)
[](https://huggingface.co/)[](https://huggingface.co/)
[](https://huggingface.co/)[](https://huggingface.co/)
## Open a Pull Request
[](https://huggingface.co/spaces/victor/ChatUI/discussions)[](https://huggingface.co/spaces/victor/ChatUI/discussions)
[](https://huggingface.co/spaces/victor/ChatUI/discussions)[](https://huggingface.co/spaces/victor/ChatUI/discussions)
[](https://huggingface.co/spaces/victor/ChatUI/discussions)[](https://huggingface.co/spaces/victor/ChatUI/discussions)
[](https://huggingface.co/spaces/victor/ChatUI/discussions)[](https://huggingface.co/spaces/victor/ChatUI/discussions)
## Subscribe to PRO
[](https://huggingface.co/subscribe/pro)[](https://huggingface.co/subscribe/pro)
[](https://huggingface.co/subscribe/pro)[](https://huggingface.co/subscribe/pro)
[](https://huggingface.co/subscribe/pro)[](https://huggingface.co/subscribe/pro)
[](https://huggingface.co/subscribe/pro)[](https://huggingface.co/subscribe/pro)
## Follow me on HF
[](https://huggingface.co/Chunte)[](https://huggingface.co/Chunte)
[](https://huggingface.co/Chunte)[](https://huggingface.co/Chunte)
[](https://huggingface.co/Chunte)[](https://huggingface.co/Chunte)
[](https://huggingface.co/Chunte)[](https://huggingface.co/Chunte)
## Model on HF
[](https://huggingface.co/models)[](https://huggingface.co/models)
[](https://huggingface.co/models)[](https://huggingface.co/models)
[](https://huggingface.co/models)[](https://huggingface.co/models)
[](https://huggingface.co/models)[](https://huggingface.co/models)
## Dataset on HF
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
## Visualize this dataset
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
[](https://huggingface.co/datasets)[](https://huggingface.co/datasets)
## Powered by Hugging Face
[](https://huggingface.co)[](https://huggingface.co)
## Built with ML Intern
[](https://hf.co/chat?mode=ml-intern)[](https://hf.co/chat?mode=ml-intern)
[](https://hf.co/chat?mode=ml-intern)[](https://hf.co/chat?mode=ml-intern)
[](https://hf.co/chat?mode=ml-intern)[](https://hf.co/chat?mode=ml-intern)
[](https://hf.co/chat?mode=ml-intern)[](https://hf.co/chat?mode=ml-intern)123version https://git-lfs.github.com/spec/v1oid sha256:1c670592660c697f4db286cfa4d1c7f60f0c1fb96d5f6dc4e043ac3f44ad5dd9size 1466823.gitattributes+1
LICENSEAdded+23
README.mdAdded+89
lance/actions.lance/_transactions/0-dff36fc6-f01e-49b3-bf58-15f2cb72e88a.txnAdded
lance/actions.lance/_versions/18446744073709551614.manifestAdded
lance/actions.lance/_versions/latest_version_hint.jsonAdded+1
lance/actions.lance/data/1101001100010011111011116f4d02491f90f07be5f170c554.lanceAdded
lance/assets.lance/_transactions/0-f3e216c6-0c9a-4a89-aab9-a94e1c5390b3.txnAdded
lance/assets.lance/_versions/18446744073709551614.manifestAdded
lance/assets.lance/_versions/latest_version_hint.jsonAdded+1
lance/assets.lance/data/1011001111100100000110013fc66d4045b833987b8f36d33b.lanceAdded+3
source/README.mdAdded+259
source/badges-thumbnail.pngAdded
Large File Pointer Details
- SHA256: a623554c620ae84569d87488e6c07b46007f485f65829af5bd6ffb913d9eb275
- Pointer size: 131 Bytes
- Size of remote file: 237 kB
viewer/badges.parquetAdded+3