Run this model with HF Jobs
Run ZibinDong/ActionCodec2 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/ZibinDong/ActionCodec2. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/ZibinDong/ActionCodec2 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use ZibinDong/ActionCodec2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZibinDong/ActionCodec2 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ZibinDong/ActionCodec2", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download runtime/backends/actioncodec2/packing.py from ZibinDong/ActionCodec2: direct link, hf CLI and curl.
- Browser
- Download file 1.51 kB
-
https://huggingface.co/ZibinDong/ActionCodec2/resolve/ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/backends/actioncodec2/packing.py
- Command line
-
hf download hf://ZibinDong/ActionCodec2@ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/backends/actioncodec2/packing.py
-
curl -L -o packing.py https://huggingface.co/ZibinDong/ActionCodec2/resolve/ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/backends/actioncodec2/packing.py
1.51 kB
| """Runtime opt-in controls for lossless fixed-vocabulary Set-BPE search.""" | |
| from __future__ import annotations | |
| from dataclasses import dataclass | |
| class EncodingSearch: | |
| 'Independent post-encoding stages; defaults retain ranked merge replay.' | |
| spatial_search: bool = False | |
| temporal_search: bool = False | |
| search_window: int = 32 | |
| search_beam: int = 4 | |
| def __post_init__(self): | |
| for name in ("spatial_search", "temporal_search"): | |
| if not isinstance(getattr(self, name), bool): | |
| raise TypeError(f"{name} must be a bool") | |
| for name in ("search_window", "search_beam"): | |
| value = getattr(self, name) | |
| if isinstance(value, bool) or not isinstance(value, int) or value < 1: | |
| raise ValueError(f"{name} must be a positive integer") | |
| if self.search_beam > 64: | |
| raise ValueError("search_beam must be at most 64") | |
| def enabled(self): | |
| return self.spatial_search or self.temporal_search | |
| def validate_codec(self, scheme, bins): | |
| if not self.enabled: | |
| return | |
| if scheme != "set_bpe": | |
| raise ValueError("packing search requires set_bpe") | |
| if len(bins) > 8 or max(bins) > 255: | |
| raise ValueError("packing search supports at most eight slots and 255 bins per slot") | |
| if self.search_window * len(bins) > 256: | |
| raise ValueError("search_window times profile width must be at most 256") | |