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)


235
236
237
238
# File 'ext/llama_cpp/llama_cpp.c', line 235

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)


230
231
232
233
# File 'ext/llama_cpp/llama_cpp.c', line 230

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)


240
241
242
243
# File 'ext/llama_cpp/llama_cpp.c', line 240

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;
}