docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Namespace Unity.InferenceEngine.Tokenization.Truncators.Strategies

    Classes

    LongestFirstStrategy

    Truncation strategy that iteratively truncates the longest sequence first. This strategy attempts to balance the lengths of both sequences by removing tokens from the longer sequence until the combined length fits within the maximum allowed length.

    OnlyFirstStrategy

    Truncation strategy that only truncates the first sequence. The second sequence length is preserved, and the first sequence is adjusted to fit within the maximum length.

    OnlySecondStrategy

    Truncation strategy that only truncates the second sequence. The first sequence length is preserved, and the second sequence is adjusted to fit within the maximum length.

    Interfaces

    ITruncationStrategy

    Defines a strategy for truncating token sequences to fit within a maximum length constraint. Implementations determine how to distribute the available length between two token sequences.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)