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/frontend/actioncodec2_sparse/__init__.py from ZibinDong/ActionCodec2: direct link, hf CLI and curl.
- Browser
- Download file 842 Bytes
-
https://huggingface.co/ZibinDong/ActionCodec2/resolve/ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/frontend/actioncodec2_sparse/__init__.py
- Command line
-
hf download hf://ZibinDong/ActionCodec2@ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/frontend/actioncodec2_sparse/__init__.py
-
curl -L -o __init__.py https://huggingface.co/ZibinDong/ActionCodec2/resolve/ef300dff7f6ffa4e4e7eef5fdfef0fd684e7d573/runtime/frontend/actioncodec2_sparse/__init__.py
842 Bytes
| """ActionCodec2Sparse frontend: action-space binding, release loading and generation constraints.""" | |
| from transformers import AutoConfig, AutoProcessor, PretrainedConfig | |
| from .generation import ActionCodec2SparseLogitsProcessor | |
| from .processor import ActionCodec2Sparse | |
| class ActionCodec2SparseHFConfig(PretrainedConfig): | |
| """AutoConfig discovery key for :class:`ActionCodec2Sparse` artifacts.""" | |
| model_type = ActionCodec2Sparse.model_type | |
| def __init__(self, **kwargs): | |
| kwargs.setdefault("processor_class", "ActionCodec2Sparse") | |
| super().__init__(**kwargs) | |
| AutoConfig.register(ActionCodec2Sparse.model_type, ActionCodec2SparseHFConfig, exist_ok=True) | |
| AutoProcessor.register(ActionCodec2SparseHFConfig, ActionCodec2Sparse, exist_ok=True) | |
| __all__ = ["ActionCodec2Sparse", "ActionCodec2SparseLogitsProcessor"] | |