Skip to content

< Back


LLamaToken

Namespace: LLama.Native

A single token

1
public struct LLamaToken

Inheritance ObjectValueTypeLLamaToken
Implements IEquatable<LLamaToken>
Attributes NullableContextAttribute, NullableAttribute, IsReadOnlyAttribute, DebuggerDisplayAttribute

Fields

InvalidToken

Token Value used when token is inherently null

1
public static LLamaToken InvalidToken;

Methods

GetAttributes(SafeLlamaModelHandle)

Get attributes for this token

1
LLamaTokenAttr GetAttributes(SafeLlamaModelHandle model)

Parameters

model SafeLlamaModelHandle

Returns

LLamaTokenAttr

GetAttributes(Vocabulary)

Get attributes for this token

1
LLamaTokenAttr GetAttributes(Vocabulary vocab)

Parameters

vocab Vocabulary

Returns

LLamaTokenAttr

GetScore(Vocabulary)

Get score for this token

1
float GetScore(Vocabulary vocab)

Parameters

vocab Vocabulary

Returns

Single

IsControl(SafeLlamaModelHandle)

Check if this is a control token

1
bool IsControl(SafeLlamaModelHandle model)

Parameters

model SafeLlamaModelHandle

Returns

Boolean

IsControl(Vocabulary)

Check if this is a control token

1
bool IsControl(Vocabulary vocab)

Parameters

vocab Vocabulary

Returns

Boolean

IsEndOfGeneration(SafeLlamaModelHandle)

Check if this token should end generation

1
bool IsEndOfGeneration(SafeLlamaModelHandle model)

Parameters

model SafeLlamaModelHandle

Returns

Boolean

IsEndOfGeneration(Vocabulary)

Check if this token should end generation

1
bool IsEndOfGeneration(Vocabulary vocab)

Parameters

vocab Vocabulary

Returns

Boolean

ToString()

1
string ToString()

Returns

String

GetHashCode()

1
int GetHashCode()

Returns

Int32

Equals(Object)

1
bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

Equals(LLamaToken)

1
bool Equals(LLamaToken other)

Parameters

other LLamaToken

Returns

Boolean


< Back