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
File size: 842 Bytes
1bfc3f0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | """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"]
|