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: 377 Bytes
7c09a0c 1bfc3f0 7c09a0c 1bfc3f0 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | """Shared lightweight types for the frontend layer."""
from __future__ import annotations
from typing import NamedTuple
import numpy as np
import torch
ActionIdxBatch = list[list[int]]
TokenIds = list[int] | np.ndarray | torch.Tensor
class DecodeResult(NamedTuple):
action: torch.Tensor
absent_keys: set
__all__ = ["ActionIdxBatch", "TokenIds", "DecodeResult"]
|