Class: SpecialTokensText
Constructors
new SpecialTokensText()
ts
new SpecialTokensText(value: string): SpecialTokensText
Parameters
Parameter | Type |
---|---|
value | string |
Returns
Defined in
Properties
value
ts
readonly value: string;
Defined in
Methods
toString()
ts
toString(): string
Returns
string
Defined in
tokenize()
ts
tokenize(tokenizer: Tokenizer, trimLeadingSpace: boolean): Token[]
Parameters
Parameter | Type | Default value |
---|---|---|
tokenizer | Tokenizer | undefined |
trimLeadingSpace | boolean | false |
Returns
Token
[]
Defined in
tokenizeSpecialTokensOnly()
ts
tokenizeSpecialTokensOnly(tokenizer: Tokenizer): (string | Token)[]
Parameters
Parameter | Type |
---|---|
tokenizer | Tokenizer |
Returns
(string
| Token
)[]
Defined in
toJSON()
ts
toJSON(): LlamaTextSpecialTokensTextJSON
Returns
LlamaTextSpecialTokensTextJSON
Defined in
fromJSON()
ts
static fromJSON(json: LlamaTextSpecialTokensTextJSON): SpecialTokensText
Parameters
Parameter | Type |
---|---|
json | LlamaTextSpecialTokensTextJSON |
Returns
Defined in
isSpecialTokensTextJSON()
ts
static isSpecialTokensTextJSON(value: LlamaTextJSONValue): value is LlamaTextSpecialTokensTextJSON
Parameters
Parameter | Type |
---|---|
value | LlamaTextJSONValue |
Returns
value is LlamaTextSpecialTokensTextJSON
Defined in
wrapIf()
ts
static wrapIf(shouldWrap: boolean, value: string): string | SpecialTokensText
Wraps the value with a SpecialTokensText
only if shouldWrap
is true
Parameters
Parameter | Type |
---|---|
shouldWrap | boolean |
value | string |
Returns
string
| SpecialTokensText