Class: LlamaCpp::LlamaTokenDataArray

Inherits:
Object
  • Object
show all
Defined in:
ext/llama_cpp/llama_cpp.c,
ext/llama_cpp/llama_cpp.c

Overview

“struct llama_token_data_array” wrapper class

Instance Method Summary collapse

Instance Method Details

#selectedInteger

Returns:

  • (Integer)


237
238
239
240
# File 'ext/llama_cpp/llama_cpp.c', line 237

static VALUE llama_token_data_array_get_selected(VALUE self) {
  llama_token_data_array* data = get_llama_token_data_array(self);
  return SIZET2NUM(data->selected);
}

#sizeInteger

Returns:

  • (Integer)


232
233
234
235
# File 'ext/llama_cpp/llama_cpp.c', line 232

static VALUE llama_token_data_array_get_size(VALUE self) {
  llama_token_data_array* data = get_llama_token_data_array(self);
  return SIZET2NUM(data->size);
}

#sortedBoolean

Returns:

  • (Boolean)


242
243
244
245
# File 'ext/llama_cpp/llama_cpp.c', line 242

static VALUE llama_token_data_array_get_sorted(VALUE self) {
  llama_token_data_array* data = get_llama_token_data_array(self);
  return data->sorted ? Qtrue : Qfalse;
}